From 1f66bac645a29ae67dd34e421de7a947fc8bae16 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 30 Oct 2024 18:46:33 -0400 Subject: [PATCH] **kwargs consistiency --- t.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 t.py diff --git a/t.py b/t.py new file mode 100644 index 0000000..c8942a5 --- /dev/null +++ b/t.py @@ -0,0 +1,27 @@ +from typing import Optional, Type +from pydantic import BaseModel + +from simplemind import Session + +# Example usage: +if __name__ == "__main__": + # Create a session with default settings + session = Session(llm_provider="openai", llm_model="gpt-4o-mini") + + # Use the session for text generation + response = session.generate_text("Tell me about the future of AI") + + # Create a conversation using session defaults + conversation = session.create_conversation() + + # Generate structured data with Pydantic + class Recipe(BaseModel): + name: str + ingredients: list[str] + instructions: list[str] + + recipe = session.generate_data( + "Give me a recipe for chocolate chip cookies", response_model=Recipe + ) + + print(locals())