Conversation
updated agent.py to use Together AI API; added agent_memory.py and web_research.py (part 2 code); updated README
added more comments, added 1 more question
Updated README to include detailed instructions for the programming assignment, including setup notes, assignment parts, and specific requirements for submission.
README.md
Outdated
There was a problem hiding this comment.
Maybe we should add these as in-line comments as well?
|
|
||
| ### Interfacing with Databases (20 points) | ||
|
|
||
| An important part of building a customer service agent is to be able to interface with databases to gather and record information about the user and the movies. As a starting point, implement the `book_ticket` and `file_request` tools in `agent.py` and integrate them into your agent. |
There was a problem hiding this comment.
I don't think we have starter code for file_request, find_time, find_price, and find_balance yet. @sunnyych Could you add the starter code and code comments for these functions please?
| - print request_database | ||
| ``` | ||
|
|
||
| Apart from the above transcript, you are also encouraged to add additional user questions that can showcase the use of all the tools you implemented. Make sure that you save the full trajectories of the agent's responses as we showed above in your transcript. Save the transcript as `transcript_part1.txt`. |
There was a problem hiding this comment.
How should students create the transcript.txt? I think we need to give directions. TODO @juliabiswas
|
|
||
| Apart from the above transcript, you are also encouraged to add additional user questions that can showcase the use of all the tools you implemented. Make sure that you save the full trajectories of the agent's responses as we showed above in your transcript. Save the transcript as `transcript_part1.txt`. | ||
|
|
||
| ## Assignment Part 2: Real-World Extensions (50 points) |
There was a problem hiding this comment.
Consider making these less points since implementation is less heavy?
README.md
Outdated
|
|
||
| You will complete and run code in web_search.py for this part of the assignment. We provide most of the implementation, including the WebTools class, which enables the search functionality using the code described above. WebTools will be used in the WebSearchAgent class. Before you run the script, please remember to set the SERPAPI_API_KEY value to your api key. You will finish implementing the following three components: | ||
|
|
||
| 1. Complete the WebSearchQA class by defining the objective of the agent and defining the input and response (hint: it might be helpful to reference the MovieTicketAgent class from agent.py) |
There was a problem hiding this comment.
Do they need to define the docstring as well? Also, can you add code comments for this function please
| user_input: str = #TODO | ||
| response: str = #TODO | ||
|
|
||
| class WebSearchAgent(dspy.Module): |
There was a problem hiding this comment.
Could you maybe add a comment about how this signature works (essentially WebSearchAgent is a wrapper on dspy.Module)
| class WebSearchAgent(dspy.Module): | ||
| """A ReAct agent enhanced with web search capabilities.""" | ||
|
|
||
| def __init__(self): |
There was a problem hiding this comment.
I think students might need more instructions on how to complete these
| max_iters=6 | ||
| ) | ||
|
|
||
| def forward(self, user_input: str): |
There was a problem hiding this comment.
Same here. Maybe add some comments that may help the student?
|
|
||
| ### Transcript and Submission for Assignment Part 2 | ||
|
|
||
| Similar to Part 1, include the above example queries as well as additional user questions that can showcase the use of all the tools you implemented. Save the transcript as `transcript_part2.txt`. You should make sure to showcase that the agent is able to remember past interactions with the user and use that memory to personalize the conversation, and that it can make tool calls to the web search tool and answer questions based on the latest information. |
There was a problem hiding this comment.
Same here. Let's clarify how they submit the transcript. Maybe pending autograder
| 3. Finish writing the `forward` function | ||
| 4. Write 5 more prompts that can test the agent's web search ability | ||
|
|
||
| Now, to test the agent's web search capabilities, run `python web_search.py`! |
There was a problem hiding this comment.
I wrote this as a placeholder. Feel free to change this if it's not completely accurate
| from mem0 import Memory | ||
|
|
||
| # Configure environment | ||
| os.environ["OPENAI_API_KEY"] = "your-openai-api-key" |
There was a problem hiding this comment.
Maybe update this to remove all the OpenAI references
| class MovieTicketAgent(dspy.Signature): | ||
| """You are a movie ticket agent that helps user book and manage movie tickets. | ||
| """ | ||
| You are a movie ticket agent that helps user book and manage movie tickets. |
There was a problem hiding this comment.
Could we give them some comments on how this docstring works? Like how the Dspy agent reads in this docstring and uses it to initialize the agent? Maybe add # comments or add something in the README
|
@sunnyych I think we also need to give students directions on how to run their agent after each part |
|
|
||
| **We will use your API key to run the autograder on your submission alone. It is important that you make sure there is at least $0.1 left in your account.** If you would like to work out an alternative accomodation please make a private Ed post. | ||
|
|
||
| **We will use your API key to run the autograder on your submission alone. It is important that you make sure there is at least $0.1 left in your account.** If you would like to work out an alternative accomodation please make a private Ed post. |
There was a problem hiding this comment.
@juliabiswas TODO: Change this part once we figure out how we want to set up the autograder. We might have to add more info (the rubrics that we are going to use, the ethics portion, etc.) You can reference last year's PA7 README here
No description provided.