-
Notifications
You must be signed in to change notification settings - Fork 5k
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]: reflection_with_llm issue with local server #2492
Comments
Did a run and added some comments to ConversableAgent to try to track down the issue and I still can't figure out what it is:
From what I see, despite the flows (reflection_with_llm and normal generate_reply) being distinct, I cannot see why _generate_oai_reply_from_client's response is empty with reflection_with_llm. There's clearly an issue since the reflection flow _generate_oai_reply_from_client response object shows prompt tokens as 1, but the messages object being passed seems correct. |
Have you checked the logs on your local model server? |
[2024-04-24 22:54:11.733] [INFO] Received POST request to /v1/chat/completions with body: { |
Ok, I figured it out.
It could be as simple as allowing the prompt argument to be an Union[str, dict] that gets deployed accordingly in _reflection_with_llm. Wouldn't affect behavior of current implementations, and allow this minor issue to be solved. I can do a PR with this if that's ok? |
@MarianoMolina perfect. Yes a PR on this option sounds great! It can be added to |
Describe the bug
There seems to be an issue with generating the reflection_with_llm summary when working with locally deployed models.
Below is a simple snippet that when run with my local model, it generates the conversation correctly, but the ChatResult summary is empty. When I run it using gpt4, it generates the summary correctly.
Steps to reproduce
from autogen import GroupChatManager, GroupChat, config_list_from_json, ConversableAgent, UserProxyAgent
config_list = config_list_from_json(
env_or_file="OAI_CONFIG_LIST",
file_location=".",
filter_dict={
"model": ["TheBloke/Mistral-7B-Instruct-v0.2-GGUF/mistral-7b-instruct-v0.2.Q6_K.gguf"],
},
)
llm_config = {
"cache_seed": False, # change the cache_seed for different trials
"temperature": 0,
"config_list": config_list,
"timeout": 120,
}
user_proxy_auto = UserProxyAgent(
name="user_proxy_auto",
code_execution_config=False,
llm_config=llm_config
)
drafter_agent = ConversableAgent(
name="drafter",
llm_config=llm_config,
system_message="You are an assistant in charge of drafting the answer for the task.",
)
reviewer_agent = ConversableAgent(
name="reviewer",
llm_config=llm_config,
system_message="You are an assistant in charge of reviewing the drafted answer and assess its quality in terms of tackling the task successfully and effectively. You can make adjustments directly, request a completely new draft while providing a framework to approach the task more effectively, or approve the answer as is. If the task is complete, end the task with
TERMINATE
",)
group_chat = GroupChat(
agents=[drafter_agent, reviewer_agent, user_proxy_auto],
messages=[],
max_round=4,
speaker_selection_method="round_robin"
)
chat_manager = GroupChatManager(
groupchat=group_chat,
llm_config=llm_config
)
chat_result = user_proxy_auto.initiate_chat(
chat_manager,
message="List 5 roles/positions that benefit strongly from a high EQ, and list your reasons.",
clear_history=True,
summary_args={"summary_prompt": "List the final answer to the task."},
summary_method="reflection_with_llm"
)
print(f'chat_result history: {chat_result.chat_history}')
print(f'chat_result summary: {chat_result.summary}')
Model Used
TheBloke/Mistral-7B-Instruct-v0.2-GGUF/mistral-7b-instruct-v0.2.Q6_K.gguf -> LMStudio
gpt-4-turbo-2024-04-09 -> OpenAI
Expected Behavior
reflection_with_llm not generating the output when using local model
Screenshots and logs
No response
Additional Information
Name: pyautogen
Version: 0.2.23
The text was updated successfully, but these errors were encountered: