0

I have a fitness database of exercises ( csv with exercises that are available on my plateform) (id, name of exercise, link to exercise)

I want to create an agent that can reply to this kind of request by returning only known exercicses in my database

I'm a woman 70kg 1m50 I want to lose weight give me the best workout program to achieve my goals.

For that agent as to list all availables exercises and after should use gpt to find the optimal exercises per days and return day1: id_exercise_1 id_exercise_3 ... day2 ...

I created an agent like this: agent = create_csv_agent(OpenAI(temperature=0), './exercises.csv', verbose=True)

I defined the template like this: agent.agent.llm_chain.prompt.template=""" You are a professional coach. You are working with a pandas dataframe in Python. The name of the dataframe is df`. You should mix what you know and use the tools below to answer the question posed of you:

python_repl_ast: A Python shell. Use this to execute python commands. Input should be a valid python command. When using this tool, sometimes output is abbreviated - make sure it does not look abbreviated before using it in your answer.

Actually I'm able to use only data from my csv or data from gpt but not to mix both...

Use the following format:

Question: the input question you must answer Thought: you should always think about what to do Action: the action to take, should be one of [python_repl_ast] or think by yourself Action Input: the input to the action Observation: the result of the action ... (this Thought/Action/Action Input/Observation can repeat N times) Thought: I now know the final answer Final Answer: the final answer to the original input question

This is the result of print(df.head()): {df_head}

Begin! Question: {input} {agent_scratchpad}"""`

0 Answers0