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

[Bug]: register_for_llm overwrites client, breaking custom model clients #2707

Open
Basekill opened this issue May 17, 2024 · 1 comment
Open
Labels
bug Something isn't working function/tool suggestion and execution of function/tool call

Comments

@Basekill
Copy link

Basekill commented May 17, 2024

Describe the bug

When trying to register a function for an LLM, it will overwrite the custom model client registered, leading to a PlaceholderClient.

self.client = OpenAIWrapper(**self.llm_config)

This should not overwrite existing custom model clients

Steps to reproduce

assistant = ConversableAgent(
    name="Assistant",
    system_message="You are a helpful AI assistant. "
                   "You can help with simple calculations."
                   "Return 'TERMINATE' when the task is done.",
    llm_config={"config_list": [custom_config]},
)

assistant.register_model_client(model_client_cls=CustomModelClient)  # Registers custom model client
assistant.register_for_llm(name="calculator", description="A simple calculator")(calculator)  # Overwrites custom model client
  1. Create an agent
  2. Register a custom model client
  3. Register a function for an LLM
  4. The client is overwritten so we are left with a PlaceholderClient instead of the registered custom model client

Model Used

Custom Model (with GPT-4)

Expected Behavior

The function should be registered without overwriting the custom model client

Screenshots and logs

No response

Additional Information

No response

@Basekill Basekill added the bug Something isn't working label May 17, 2024
@ekzhu ekzhu added the function/tool suggestion and execution of function/tool call label May 17, 2024
@ekzhu
Copy link
Collaborator

ekzhu commented May 22, 2024

@Basekill would you be interested in helping out here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working function/tool suggestion and execution of function/tool call
Projects
None yet
Development

No branches or pull requests

2 participants