Skip to content

docs(grok): fix MemoryService initialization example#405

Open
octo-patch wants to merge 1 commit intoNevaMind-AI:mainfrom
octo-patch:fix/grok-docs-llm-profiles-param
Open

docs(grok): fix MemoryService initialization example#405
octo-patch wants to merge 1 commit intoNevaMind-AI:mainfrom
octo-patch:fix/grok-docs-llm-profiles-param

Conversation

@octo-patch
Copy link
Copy Markdown

Problem

The code example in docs/providers/grok.md passes LLMConfig via a non-existent llm_config keyword argument:

service = MemoryService(llm_config=llm_config)  # ❌ wrong parameter name

Running this code raises:

TypeError: MemoryService.__init__() got an unexpected keyword argument 'llm_config'

MemoryService.__init__ does not accept llm_config; the correct parameter is llm_profiles.

Solution

  • Use llm_profiles={"default": llm_config} instead of llm_config=llm_config
  • Add os.environ.get("GROK_API_KEY", "") for the API key so the example is copy-pasteable and actually works

Testing

Verified by reading MemoryService.__init__ signature in src/memu/app/service.py.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant