Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions docs/providers/grok.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@ You can enable the Grok provider by setting the `provider` field to `"grok"` in
### Using Python Configuration

```python
import os
from memu.app.settings import LLMConfig
from memu.app.service import MemoryService

# Configure the LLM provider to use Grok
llm_config = LLMConfig(provider="grok")
llm_config = LLMConfig(
provider="grok",
api_key=os.environ.get("GROK_API_KEY", ""),
)

# Initialize the service
service = MemoryService(llm_config=llm_config)
# Initialize the service — pass config via llm_profiles, not llm_config
service = MemoryService(llm_profiles={"default": llm_config})
print(f"Service initialized with model: {llm_config.chat_model}")
# Output: Service initialized with model: grok-2-latest
```
Expand Down