Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported LLM provider and Unsupported embedding provider #1950

Open
fate-think opened this issue Oct 9, 2024 · 1 comment
Open

Unsupported LLM provider and Unsupported embedding provider #1950

fate-think opened this issue Oct 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@fate-think
Copy link

🐛 Describe the bug

when I excute the test.py ,I get some errors of Unsupported LLM provider and Unsupported embedding provider.By the way,I add chatglm to oneapi,and passed the test in oneapi.So,I have a openai-like api.And When I call the api in fastgpt,it works well.So it is clear that the api is fine and can be called normally.


My original codes is blow:
({xxx} represent my privacy information)

import os
from mem0 import Memory

os.environ["OPENAI_API_KEY"] = "{xxx}"
os.environ["OPENAI_API_BASE"] = "{xxx}"

config = {
    "llm": {
        "provider": "openai-like",
        "config": {
            "model": "glm-4-plus",
            "temperature": 0.2,
            "max_tokens": 2500,
        }
    },
    "embedder": { 
        "provider": "openai-like",
        "config": { 
            "model": "embedding-3" 
                 } 
    },
    "vector_store": {
        "provider": "qdrant",
        "config": {
            "collection_name": "test",
            "host": "{xxx}", 
            "port": {xxx},
            "embedding_model_dims": 3072,
        }
    },
    "version": "v1.1",
}

m = Memory.from_config(config)
m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})

Errors I got :

Configuration validation error: 2 validation errors for MemoryConfig
llm.config
  Value error, Unsupported LLM provider: openai-like [type=value_error, input_value={'model': 'glm-4-plus', '...0.2, 'max_tokens': 2500}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.8/v/value_error
embedder.config
  Value error, Unsupported embedding provider: openai-like [type=value_error, input_value={'model': 'embedding-3'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.8/v/value_error
Traceback (most recent call last):
  File "/root/mem0test1.py", line 34, in <module>
    m = Memory.from_config(config)
  File "/usr/local/lib/python3.9/dist-packages/mem0/memory/main.py", line 55, in from_config
    config = MemoryConfig(**config_dict)
  File "/usr/local/lib/python3.9/dist-packages/pydantic/main.py", line 193, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 2 validation errors for MemoryConfig
llm.config
  Value error, Unsupported LLM provider: openai-like [type=value_error, input_value={'model': 'glm-4-plus', '...0.2, 'max_tokens': 2500}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.8/v/value_error
embedder.config
  Value error, Unsupported embedding provider: openai-like [type=value_error, input_value={'model': 'embedding-3'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.8/v/value_error
@spike-spiegel-21
Copy link
Collaborator

Hey @fate-think, mem0 does not support open-like as of now. Try with openai.

@Dev-Khant Dev-Khant added the bug Something isn't working label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants