[Update] Default LLM (#3587)
This commit is contained in:
@@ -202,7 +202,7 @@ async def chat_with_memories(message: str, user_id: str = "default_user") -> str
|
||||
# Generate assistant response
|
||||
system_prompt = f"You are a helpful AI. Answer the question based on query and memories.\nUser Memories:\n{memories_str}"
|
||||
messages = [{"role": "system", "content": system_prompt}, {"role": "user", "content": message}]
|
||||
response = await async_openai_client.chat.completions.create(model="gpt-4o-mini", messages=messages)
|
||||
response = await async_openai_client.chat.completions.create(model="gpt-4.1-nano-2025-04-14", messages=messages)
|
||||
assistant_response = response.choices[0].message.content
|
||||
|
||||
# Create new memories from the conversation
|
||||
@@ -249,7 +249,7 @@ async def handle_initialization_errors():
|
||||
# Initialize with custom config
|
||||
config = MemoryConfig(
|
||||
vector_store={"provider": "chroma", "config": {"path": "./chroma_db"}},
|
||||
llm={"provider": "openai", "config": {"model": "gpt-4o-mini"}}
|
||||
llm={"provider": "openai", "config": {"model": "gpt-4.1-nano-2025-04-14"}}
|
||||
)
|
||||
memory = AsyncMemory(config=config)
|
||||
print("AsyncMemory initialized successfully")
|
||||
|
||||
@@ -76,7 +76,7 @@ config = {
|
||||
"llm": {
|
||||
"provider": "openai",
|
||||
"config": {
|
||||
"model": "gpt-4o",
|
||||
"model": "gpt-4.1-nano-2025-04-14",
|
||||
"temperature": 0.2,
|
||||
"max_tokens": 2000,
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ messages = [
|
||||
user_id = "alice"
|
||||
chat_completion = client.chat.completions.create(
|
||||
messages=messages,
|
||||
model="gpt-4o-mini",
|
||||
model="gpt-4.1-nano-2025-04-14",
|
||||
user_id=user_id
|
||||
)
|
||||
# Memory saved after this will look like: "Loves Indian food. Allergic to cheese and cannot eat pizza."
|
||||
@@ -42,7 +42,7 @@ messages = [
|
||||
|
||||
chat_completion = client.chat.completions.create(
|
||||
messages=messages,
|
||||
model="gpt-4o-mini",
|
||||
model="gpt-4.1-nano-2025-04-14",
|
||||
user_id=user_id
|
||||
)
|
||||
print(chat_completion.choices[0].message.content)
|
||||
@@ -73,7 +73,7 @@ chat_completion = client.chat.completions.create(
|
||||
"content": "What's the capital of France?",
|
||||
}
|
||||
],
|
||||
model="gpt-4o",
|
||||
model="gpt-4.1-nano-2025-04-14",
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ You can also customize the LLM for Graph Memory from the [Supported LLM list](ht
|
||||
|
||||
1. **Main Configuration**: If `llm` is set in the main config, it will be used for all graph operations.
|
||||
2. **Graph Store Configuration**: If `llm` is set in the graph_store config, it will override the main config `llm` and be used specifically for graph operations.
|
||||
3. **Default Configuration**: If no custom LLM is set, the default LLM (`gpt-4o-2024-08-06`) will be used for all graph operations.
|
||||
3. **Default Configuration**: If no custom LLM is set, the default LLM (`gpt-4.1-nano-2025-04-14) will be used for all graph operations.
|
||||
|
||||
Here's how you can do it:
|
||||
|
||||
@@ -100,7 +100,7 @@ config = {
|
||||
"llm": {
|
||||
"provider": "openai",
|
||||
"config": {
|
||||
"model": "gpt-4o",
|
||||
"model": "gpt-4.1-nano-2025-04-14",
|
||||
"temperature": 0.2,
|
||||
"max_tokens": 2000,
|
||||
}
|
||||
@@ -115,7 +115,7 @@ config = {
|
||||
"llm" : {
|
||||
"provider": "openai",
|
||||
"config": {
|
||||
"model": "gpt-4o-mini",
|
||||
"model": "gpt-4.1-nano-2025-04-14",
|
||||
"temperature": 0.0,
|
||||
}
|
||||
}
|
||||
@@ -130,7 +130,7 @@ const config = {
|
||||
llm: {
|
||||
provider: "openai",
|
||||
config: {
|
||||
model: "gpt-4o",
|
||||
model: "gpt-4.1-nano-2025-04-14",
|
||||
temperature: 0.2,
|
||||
max_tokens: 2000,
|
||||
}
|
||||
@@ -146,7 +146,7 @@ const config = {
|
||||
llm: {
|
||||
provider: "openai",
|
||||
config: {
|
||||
model: "gpt-4o-mini",
|
||||
model: "gpt-4.1-nano-2025-04-14",
|
||||
temperature: 0.0,
|
||||
}
|
||||
}
|
||||
@@ -177,7 +177,7 @@ You can also customize the LLM for Graph Memory from the [Supported LLM list](ht
|
||||
|
||||
1. **Main Configuration**: If `llm` is set in the main config, it will be used for all graph operations.
|
||||
2. **Graph Store Configuration**: If `llm` is set in the graph_store config, it will override the main config `llm` and be used specifically for graph operations.
|
||||
3. **Default Configuration**: If no custom LLM is set, the default LLM (`gpt-4o-2024-08-06`) will be used for all graph operations.
|
||||
3. **Default Configuration**: If no custom LLM is set, the default LLM (`gpt-4.1-nano-2025-04-142025-04-14) will be used for all graph operations.
|
||||
|
||||
Here's how you can do it:
|
||||
|
||||
@@ -241,7 +241,7 @@ User can also customize the LLM for Graph Memory from the [Supported LLM list](h
|
||||
|
||||
1. **Main Configuration**: If `llm` is set in the main config, it will be used for all graph operations.
|
||||
2. **Graph Store Configuration**: If `llm` is set in the graph_store config, it will override the main config `llm` and be used specifically for graph operations.
|
||||
3. **Default Configuration**: If no custom LLM is set, the default LLM (`gpt-4o-2024-08-06`) will be used for all graph operations.
|
||||
3. **Default Configuration**: If no custom LLM is set, the default LLM (`gpt-4.1-nano-2025-04-14) will be used for all graph operations.
|
||||
|
||||
Here's how you can do it:
|
||||
|
||||
@@ -290,7 +290,7 @@ User can also customize the LLM for Graph Memory from the [Supported LLM list](h
|
||||
|
||||
1. **Main Configuration**: If `llm` is set in the main config, it will be used for all graph operations.
|
||||
2. **Graph Store Configuration**: If `llm` is set in the graph_store config, it will override the main config `llm` and be used specifically for graph operations.
|
||||
3. **Default Configuration**: If no custom LLM is set, the default LLM (`gpt-4o-2024-08-06`) will be used for all graph operations.
|
||||
3. **Default Configuration**: If no custom LLM is set, the default LLM (`gpt-4.1-nano-2025-04-14) will be used for all graph operations.
|
||||
|
||||
Here's how you can do it:
|
||||
|
||||
|
||||
@@ -504,7 +504,7 @@ chat_completion = client.chat.completions.create(
|
||||
"content": "What's the capital of France?",
|
||||
}
|
||||
],
|
||||
model="gpt-4o",
|
||||
model="gpt-4.1-nano-2025-04-14",
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user