Agent won't write code to a file nor generate a python code that it will execute to write the code to the file. #4890
Replies: 1 comment 1 reply
-
It's difficult to parse the code in your question as the formatting is messy. Is your workflow following a deterministic sequence of agents? If that is the case, it may not a good idea to use group chat. It is better to use a simple sequential workflow coded up using Python directly. For each step in the workflow, you can use agentchat to create the iterative process of an agent, but the overall sequence of steps should be deterministic. Do you have steps within each agent that are deterministic? If yes, then you should really consider removing that from an agent and separate it into a deterministic Python code via either a tool or just Python glue code. Agents are for non-deterministic sequences and general capabilities. |
Beta Was this translation helpful? Give feedback.
-
Hello I have a project where I have some agents that have to write a code in the end based on the information they gather. the issue is I want to write the final answer in a file called plugins.json. I have tried various prompting ways but it just won't write the code to the file . the prompts and project can be found here : https://github.com/hackertron/TLSN-plugin-gen
I can write the prompts here though
`info_gather_prompt = """
You will help gather the initial information needed to generate a TLSNotary plugin.
Please ask the user for the following details:
Store the collected information in the following format:
once complete send the JSON object and a summary to the request_gather_prompt.
"""
request_gather_prompt = """
2. Request Gather Agent:
This agent will filter requests that are relevant to the content that the user wants to notarize.
You will ask user to send request of the website.
you will ask in this format "send_request_function". make sure to send these exact keywords to the user.
You are responsible for gathering and filtering relevant requests.
Once the user starts interacting with the website, they will provide you with sample requests.
You will filter these requests to include only those relevant to the aspect that needs to be notarized (as specified in the
info_gather_agent
).Ask the user to provide the requests made on the website. After filtering, store the relevant request(s) in the following format:
Finally, combine all the information from the info_gather_agent and request_gather_agent into a complete JSON object:
the json above is needed by plugin_developer agent.
Once complete, send the JSON object and a summary to the plugin_developer_agent. """
plugin_developer_prompt="""
You are a TLSNotary browser extension plugin developer. Your task is to generate a TLSNotary plugin based on the information provided by the gather_info_agent.
You will receive a JSON object with details such as the website URL, API URL, sample requests/responses, and what the user wants to notarize. Using this information, you will generate the necessary plugin code.
You will follow these steps:
utils/hf.js
,index.d.ts
,index.ts
, andconfig.json
files based on the provided website and user requirements.Beta Was this translation helpful? Give feedback.
All reactions