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

Merged
merged 14 commits into from
Jan 16, 2025
Merged

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
Copy link
Collaborator

@jkppr jkppr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jkppr jkppr merged commit 124a4a9 into google:master Jan 16, 2025
24 checks passed
@itsmvd itsmvd deleted the llm-search branch January 24, 2025 15:17
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