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

[.Net][Bug]: Constructor of conversableAgentConfig does not accept LMStudioConfig as ConfigList #2609

Closed
PrinzMegahertz opened this issue May 6, 2024 · 3 comments
Assignees

Comments

@PrinzMegahertz
Copy link

PrinzMegahertz commented May 6, 2024

Describe the bug

Coming from autogen for Python, I'm used to the framework actually being able to run with LM-Studio. In case of the DotNet implementation, I can't use (as the title says) an IEnumerable of LMStudioConfig as ConfigList, even though the ConfigList is an IEnumerable of ILLMConfig, which LMStudioConfig implements as well.

Steps to reproduce

Create a valid LMStudioConfig:

internal class LLMRepository
{
    public ILLMConfig mylocalconfig()
    {
        return new LMStudioConfig("localhost", 1234);
    } 
}

Try to build an Agent that's not an LMStudioAgent

internal class AgentRepository
{
    public AssistantAgent Create_AsisstantAgent(ILLMConfig config)
    {
        IEnumerable<ILLMConfig> value = [config];
        var myAgent = new AssistantAgent(
            name: "Assistant",
            systemMessage: "You are an assistant that help user to do some tasks.",
            llmConfig: new ConversableAgentConfig
            {
                Temperature = 0,
                ConfigList = value
            });
        myAgent.RegisterPrintMessage(); // register a hook to print message nicely to console            
        return myAgent;
    }       
}

Model Used

Llama3

Expected Behavior

The Agent should have been built

Screenshots and logs

No response

Additional Information

No response

@PrinzMegahertz
Copy link
Author

First time reporting an issue on Github. I should apply the label DoNet, but haven't found out how yet.

@LittleLittleCloud LittleLittleCloud changed the title [Bug]: Constructor of conversableAgentConfig does not accept LMStudioConfig as ConfigList [.Net][Bug]: Constructor of conversableAgentConfig does not accept LMStudioConfig as ConfigList May 6, 2024
@LittleLittleCloud
Copy link
Collaborator

LittleLittleCloud commented May 6, 2024

@PrinzMegahertz Thanks for creating this issue, it's because the LMStudioCnofig is not configured in AssistantAgent right now

(see here

_ => throw new ArgumentException($"Unsupported config type {llmConfig.GetType()}"),
)

We will push a fix to add LMStudioConfig configuration in AssistentAgent. In the meantime, you can use LMStudioAgent to replace AssistantAgent. The only difference between LMStudioAgent and AssistantAgent is AssistantAgent support default reply while LMStudioAgent doesn't

@LittleLittleCloud LittleLittleCloud self-assigned this May 7, 2024
LittleLittleCloud added a commit that referenced this issue May 7, 2024
@LittleLittleCloud LittleLittleCloud mentioned this issue May 7, 2024
3 tasks
github-merge-queue bot pushed a commit that referenced this issue May 7, 2024
* add lmstudio agent to assistant agent

* fix #2609

* update updatelog

* Update Directory.Build.props
jayralencar pushed a commit to jayralencar/autogen that referenced this issue May 28, 2024
* add lmstudio agent to assistant agent

* fix microsoft#2609

* update updatelog

* Update Directory.Build.props
@LittleLittleCloud
Copy link
Collaborator

Mark as completed

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

No branches or pull requests

2 participants