Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AIStudio as a supported LLM library #3254

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

itsmvd
Copy link
Collaborator

@itsmvd itsmvd commented Dec 23, 2024

This will make it easier for users to enable AI enabled features in Timesketch (just pull an API key from https://aistudio.google.com/), instead of having to export a GCP service account key.

This library also supports a response_schema, instructing/enforcing a response from a LLM model in a provided structure.

Example:

llm_provider = current_app.config.get("LLM_PROVIDER", "aistudio")
llm = manager.LLMManager.get_provider(llm_provider)(config=current_app.config.get("LLM_PROVIDERS",{}).get(llm_provider))

schema = {
    "type": "object",
    "properties": {
        "_id": {"type": "string"},
        "message": {"type": "string"}
    }
}
response = llm.generate("Give me the most suspicious event.", response_schema=schema)
print(response)

@jkppr jkppr self-requested a review December 23, 2024 09:49
@itsmvd itsmvd force-pushed the llm-search branch 2 times, most recently from f334bbd to 53a6f82 Compare December 23, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants