docs(integrations): fix retired model IDs, v3 response shapes & vercel deps (#5842)

This commit is contained in:
Kartik
2026-06-26 13:59:33 +05:30
committed by GitHub
parent 8a92cf0306
commit a7ed68e697
6 changed files with 35 additions and 41 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ client = MemoryClient()
# Define the agent # Define the agent
agent = Agent( agent = Agent(
name="Personal Agent", name="Personal Agent",
model=OpenAIChat(id="gpt-4"), model=OpenAIChat(id="gpt-5-mini"),
description="You are a helpful personal agent that helps me with day to day activities." description="You are a helpful personal agent that helps me with day to day activities."
"You can process both text and images.", "You can process both text and images.",
markdown=True markdown=True
+2 -2
View File
@@ -43,7 +43,7 @@ OPENAI_API_KEY = os.environ.get('OPENAI_API_KEY')
memory_client = MemoryClient() memory_client = MemoryClient()
agent = ConversableAgent( agent = ConversableAgent(
"chatbot", "chatbot",
llm_config={"config_list": [{"model": "gpt-4", "api_key": OPENAI_API_KEY}]}, llm_config={"config_list": [{"model": "gpt-5-mini", "api_key": OPENAI_API_KEY}]},
code_execution_config=False, code_execution_config=False,
human_input_mode="NEVER", human_input_mode="NEVER",
) )
@@ -99,7 +99,7 @@ For more complex scenarios, you can create multiple agents:
manager = ConversableAgent( manager = ConversableAgent(
"manager", "manager",
system_message="You are a manager who helps in resolving complex customer issues.", system_message="You are a manager who helps in resolving complex customer issues.",
llm_config={"config_list": [{"model": "gpt-4", "api_key": OPENAI_API_KEY}]}, llm_config={"config_list": [{"model": "gpt-5-mini", "api_key": OPENAI_API_KEY}]},
human_input_mode="NEVER" human_input_mode="NEVER"
) )
+22 -31
View File
@@ -98,20 +98,9 @@ add_result = add_tool.invoke(add_input)
```json Output ```json Output
{ {
"results": [ "message": "Memory processing has been queued for background execution",
{ "status": "PENDING",
"memory": "Name is Alex", "event_id": "3a1b2c3d-4e5f-6789-abcd-ef0123456789"
"event": "ADD"
},
{
"memory": "Is a vegetarian",
"event": "ADD"
},
{
"memory": "Is allergic to nuts",
"event": "ADD"
}
]
} }
``` ```
</CodeGroup> </CodeGroup>
@@ -173,23 +162,25 @@ result = search_tool.invoke(search_input)
``` ```
```json Output ```json Output
[ {
{ "results": [
"id": "1a75e827-7eca-45ea-8c5c-cfd43299f061", {
"memory": "Name is Alex", "id": "1a75e827-7eca-45ea-8c5c-cfd43299f061",
"user_id": "alex", "memory": "Name is Alex",
"hash": "d0fccc8fa47f7a149ee95750c37bb0ca", "user_id": "alex",
"metadata": { "hash": "d0fccc8fa47f7a149ee95750c37bb0ca",
"food": "vegan" "metadata": {
}, "food": "vegan"
"categories": [ },
"personal_details" "categories": [
], "personal_details"
"created_at": "2024-11-27T16:53:43.276872-08:00", ],
"updated_at": "2024-11-27T16:53:43.276885-08:00", "created_at": "2024-11-27T16:53:43.276872-08:00",
"score": 0.3810526501504994 "updated_at": "2024-11-27T16:53:43.276885-08:00",
} "score": 0.3810526501504994
] }
]
}
``` ```
</CodeGroup> </CodeGroup>
+1 -1
View File
@@ -41,7 +41,7 @@ load_dotenv()
# MEM0_API_KEY = 'your-mem0-key' # Replace with your actual Mem0 API key # MEM0_API_KEY = 'your-mem0-key' # Replace with your actual Mem0 API key
# Initialize LangChain and Mem0 # Initialize LangChain and Mem0
llm = ChatOpenAI(model="gpt-4") llm = ChatOpenAI(model="gpt-5-mini")
mem0 = MemoryClient() mem0 = MemoryClient()
``` ```
+1 -1
View File
@@ -121,7 +121,7 @@ async def websocket_endpoint(websocket: WebSocket):
# LLM for response generation # LLM for response generation
llm = OpenAILLMService( llm = OpenAILLMService(
api_key=os.getenv("OPENAI_API_KEY"), api_key=os.getenv("OPENAI_API_KEY"),
model="gpt-3.5-turbo", model="gpt-5-mini",
system_prompt="You are a helpful assistant that remembers past conversations." system_prompt="You are a helpful assistant that remembers past conversations."
) )
+8 -5
View File
@@ -26,12 +26,12 @@ Install the SDK provider and AI SDK:
npm install @mem0/vercel-ai-provider ai@^6 npm install @mem0/vercel-ai-provider ai@^6
``` ```
### Peer Dependencies ### Dependencies
`@mem0/vercel-ai-provider` v3.0.0 requires: `@mem0/vercel-ai-provider` bundles `ai`, all `@ai-sdk/*` provider packages, and `@ai-sdk/provider` as regular dependencies — you do **not** need to install them separately. The install command above (`npm install @mem0/vercel-ai-provider ai@^6`) is sufficient.
- `ai` v6+ (`^6.0.199`)
- `@ai-sdk/provider` v3+ (`^3.0.10`) The only true peer dependency is `zod` (optional):
- Provider packages at v3+: `@ai-sdk/openai@^3`, `@ai-sdk/anthropic@^3`, `@ai-sdk/google@^3`, `@ai-sdk/groq@^3`, `@ai-sdk/cohere@^3` - `zod` v3+ (`^3.0.0`) — required only if you use Zod schemas in tool definitions
## Getting Started ## Getting Started
@@ -305,6 +305,8 @@ These options can be passed per-request when creating a model instance:
| `rerank` | `boolean` | Enable reranking of results | | `rerank` | `boolean` | Enable reranking of results |
| `page` | `number` | Page number for pagination | | `page` | `number` | Page number for pagination |
| `page_size` | `number` | Results per page | | `page_size` | `number` | Results per page |
| `mem0ApiKey` | `string` | Mem0 API key; overrides the `MEM0_API_KEY` env var |
| `host` | `string` | Custom Mem0 API base URL for self-hosted deployments |
## Key Features ## Key Features
@@ -312,6 +314,7 @@ These options can be passed per-request when creating a model instance:
- `retrieveMemories()`: Retrieves memory context for prompts as a formatted system prompt string. - `retrieveMemories()`: Retrieves memory context for prompts as a formatted system prompt string.
- `getMemories()`: Get memories from your profile in array format. - `getMemories()`: Get memories from your profile in array format.
- `addMemories()`: Adds user memories to enhance contextual responses. - `addMemories()`: Adds user memories to enhance contextual responses.
- `searchMemories()`: Searches memories and returns the raw results array (semantic search rather than the full retrieval pipeline).
## Migrating from v2.x ## Migrating from v2.x