Spaces:
Running
Running
VIRTUS
refactor: change book retriver agent OO to just a func, AI model change, system_propts and descriptions also changed
9b09327
| from langchain.tools import tool | |
| def get_retrieve_book_context_rag_agent_tool(agent): | |
| def retrieve_book_context_rag_agent(query: str) -> str: | |
| """Delegate the retrieve query context to the agent. | |
| Args: | |
| query: the full query of th user | |
| """ | |
| result = agent.invoke({ | |
| "messages": [{"role": "user", "content": query}] | |
| }) | |
| return result["messages"][-1].text | |
| return retrieve_book_context_rag_agent | |