diff --git a/README.md b/README.md index 03ac728..ffc9042 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,33 @@ To continue the conversation, you can call `conversation.send()` again, which re ``` +### Stop Repeating Yourself + +You can use the `Session` class to + +```python +import simplemind as sm + +# Create a session with defaults +gpt_4o_mini = sm.Session( + llm_provider="openai", + llm_model="gpt-4o-mini" +) + +# Now all calls use these defaults +response = gpt_4o_mini.generate_text("Hello!") +conversation = gpt_4o_mini.create_conversation() +``` + +This maintains the simplicity of the original API while reducing repetition. The session object also supports overriding defaults on a per-call basis: + +```python +response = gpt_4o_mini.generate_text( + "Complex task here", + llm_model="gpt-4" +) +``` + ### Basic Memory Plugin Harnessing the power of Python, you can easily create your own plugins to add additional functionality to your conversations: