Skip to content

Commit 8d591c4

Browse files
author
octo-patch
committed
docs(grok): fix MemoryService initialization example
The usage example in docs/providers/grok.md passed the LLMConfig object via a non-existent `llm_config` keyword argument, which would raise: TypeError: MemoryService.__init__() got an unexpected keyword argument 'llm_config' The correct parameter is `llm_profiles` which accepts a dict mapping profile names to LLMConfig instances. Also add os.environ.get() for the API key so the example is runnable as written.
1 parent 357aefc commit 8d591c4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docs/providers/grok.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,18 @@ You can enable the Grok provider by setting the `provider` field to `"grok"` in
3636
### Using Python Configuration
3737

3838
```python
39+
import os
3940
from memu.app.settings import LLMConfig
4041
from memu.app.service import MemoryService
4142

4243
# Configure the LLM provider to use Grok
43-
llm_config = LLMConfig(provider="grok")
44+
llm_config = LLMConfig(
45+
provider="grok",
46+
api_key=os.environ.get("GROK_API_KEY", ""),
47+
)
4448

45-
# Initialize the service
46-
service = MemoryService(llm_config=llm_config)
49+
# Initialize the service — pass config via llm_profiles, not llm_config
50+
service = MemoryService(llm_profiles={"default": llm_config})
4751
print(f"Service initialized with model: {llm_config.chat_model}")
4852
# Output: Service initialized with model: grok-2-latest
4953
```

0 commit comments

Comments
 (0)