Created
December 13, 2023 04:54
-
-
Save idontcalculate/b4a7f778c08d8e5cad5e9c082ab33e11 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from llama_index.agent import FnRetrieverOpenAIAgent | |
from llama_index.llms import OpenAI | |
# Initialize the LLM | |
llm = OpenAI(model="gpt-3.5-turbo-0613") | |
# Initialize the FnRetrieverOpenAIAgent | |
top_agent = FnRetrieverOpenAIAgent.from_retriever( | |
obj_index.as_retriever(similarity_top_k=4), | |
system_prompt=""" \ | |
You are an agent designed to answer queries about a set of given patents. | |
Please always use the tools provided to answer a question. Do not rely on prior knowledge.\ | |
""", | |
llm=llm, | |
verbose=True, | |
) | |
# baseline | |
response = base_query_engine.query( | |
"Tell me about the Death Ray" | |
) | |
print(str(response)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment