-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[Issue]: autogen studio 2.0 created agent using GPT4 but always agent won't run python codes #1800
Comments
I have same problem. Autogenstudio most of the times, won't run the code. But just gives the code. |
Hi, Agents have to be configured in a specific way to get the specific results. Some best practices. (see this article on an introduction to autogen)
In your example, you seem to have a userProxy that has instructions on tasks. I would recommend the following:
the expected effect is that when you run a task ..
|
appriciate if anyone can provide the detail agent definition |
Hi see #1423 The way GroupChat is configured is critical to the behaviors you see.
As an example, I am attaching a sample workflow config that shows a team structured to generate art content. 3 agents
Results are in the attached video. You can upload this file in autogenstudio groupchat.mp4Let me know if this is helpful. |
thanks a lot! By refer to your sample json, i modified it as below: |
Great! Glad the issue is resolved!! |
Describe the issue
Skills: search_operation_knowledge_chromadb
`import chromadb
from llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext
from llama_index.vector_stores import ChromaVectorStore
from llama_index.storage.storage_context import StorageContext
from llama_index.embeddings import HuggingFaceEmbedding
from IPython.display import Markdown, display
def search_operation_knowledge_chromadb(query_texts, n_results):
"""
根据输入的文本,从已存在的chromadb中检索返回相关结果信息.
Agent define:
userInputAnalyzerAgent
Agent Description: Receives user input questions and breaks down keywords for further processing by the KnowledgeRetrieverAgent. System Message: You are an AI Agent specialized in analyzing user input questions and extracting keywords to help the KnowledgeRetrieverAgent better understand user needs. 例如"胡苏斌做过多少个项目?总计项目人数是多少? ", 拆解关键词为项目和人数,传给下一个agent进行搜索。
knowledgeRetrieverAgent
Agent Description: Retrieve relevant information from a vector database based on user-provided query keywords. System Message: 当接收到信息后,直接运行python函数 search_operation_knowledge_chromadb({信息} , 5) ,将函数返回的结果回复给user agent。 Skills: search_operation_knowledge_chromadb
Steps to reproduce
`胡苏斌做过多少个项目?总计项目人数是多少?
knowledgeRetrieverAgent (to userInputAnalyzerAgent):
为了回答您的问题,我需要从数据库中检索有关胡苏斌的项目信息。我将使用 search_operation_knowledge_chromadb 技能来执行这项任务。请稍等,我将为您提供所需的信息。
userInputAnalyzerAgent (to knowledgeRetrieverAgent):
很抱歉,但我无法直接访问数据库或执行实际的数据库查询。我的功能是基于公开可用的信息和我已有的知识来提供帮助。如果您能提供更多关于胡苏斌的背景信息或者他参与的项目
的具体细节,我可以尝试帮助您找到相关的公开信息。如果胡苏斌是一个公众人物或者他的项目信息在网上有记录,我可以帮助您查找相关信息。如果不是,您可能需要直接联系胡苏
斌或他的工作单位来获取这些数据。
knowledgeRetrieverAgent (to userInputAnalyzerAgent):
我将执行一个查询来检索胡苏斌参与的项目数量以及这些项目的总人数。请稍候片刻。
userInputAnalyzerAgent (to knowledgeRetrieverAgent):
抱歉,可能有些误解。作为一个人工智能助手,我实际上无法执行数据库查询或访问任何外部系统来检索特定个人的信息。我的能力限于提供基于公开信息的知识和帮助`
Screenshots and logs
No response
Additional Information
I want to know why agents not run python codes.
How to archieve the same effect as below autogen python codes:
`class MyRetrieveUserProxyAgent(RetrieveUserProxyAgent):
def query_vector_db(
self,
query_texts: List[str],
n_results: int = 10,
search_string: str = "",
**kwargs,
) -> Dict[str, List[List[Any]]]:
return query_vector_db(query_texts, n_results, search_string, **kwargs)
Init agent
boss_aid = MyRetrieveUserProxyAgent(
name="Boss_Assistant",
is_termination_msg=termination_msg,
system_message="Assistant who has extra content retrieval power for solving difficult problems. When the relevant info is not in CONTEXT, call 'UPDATE CONTEXT'",
human_input_mode="NEVER",
max_consecutive_auto_reply=3,
retrieve_config={
"task": "qa",
#"customized_prompt": PROMPT_SYSTEM
},
code_execution_config=False, # we don't want to execute code in this case.
)`
The text was updated successfully, but these errors were encountered: