Find answers from the community

Home
Members
larrygzlb
l
larrygzlb
Offline, last seen 2 months ago
Joined September 25, 2024
@kapa.ai How to use llama 2 in llamaindex
3 comments
k
@kapa.ai Is it possible to create a query engine object without index?
2 comments
k
Hi there, I am following this tutorial to have a Retrieval-Augmented Agent, https://docs.llamaindex.ai/en/stable/examples/agent/openai_agent_retrieval/
However I am wondering whether the async query works here? Assume that I want the Agent to use 5 tools.
Plain Text
obj_index = ObjectIndex.from_objects(
    query_engine_tools,
    index_cls=VectorStoreIndex,
)
agent = OpenAIAgent.from_tools(
    llm=self.llm_azure_gpt35,
    tool_retriever=obj_index.as_retriever(similarity_top_k=5),
    verbose=True,
)

response = await agent.aquery("Use 5 tools to plan the route")

From my observation on the progress, I feel the Agent uses the tools one by one, which is time-consuming.
4 comments
l
L
l
larrygzlb
·

OpenAI

Hello, can anyone help with a small question here?:

Plain Text
WARNING:llama_index.llms.openai_utils:Retrying llama_index.llms.openai_utils.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised Timeout: Request timed out: HTTPSConnectionPool(host='api.openai.com', port=443): Read timed out. (read timeout=600).
Retrying llama_index.llms.openai_utils.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised Timeout: Request timed out: HTTPSConnectionPool(host='api.openai.com', port=443): Read timed out. (read timeout=600).


Is this a problem of the pipeline or the openai api?
For the same query to the same engine, sometimes it takes 10min to retry and response, but normally it takes less than 15 seconds.
2 comments
l
W
@kapa.ai What is the difference between LLMSelector and PydanticSelecotr during operation
2 comments
k
Hi, Can anyone help me with this issue?

dependency:
llama-index 0.9.5
openai 1.3.4

I set up the api on AzureOpenai with:
  1. model = gpt-4(0613)
  2. model = gpt-4(1106-Preview)
  3. model = gpt-35-turbo(0613)
I initialize llm by
Plain Text
llm = AzureOpenAI(
    model="gpt-35-turbo", # or model="gpt-4(0613)" or model="gpt-4(1106-Preview)"
    deployment_name="NAME",
    api_key="API",
    azure_endpoint="ENDPOINT",
    api_version="2023-08-01-preview",
)


When I set up the PydanticSingleSelector on Router Query Engine:

Plain Text
selector=PydanticSingleSelector.from_defaults(llm=llm)


It works well with llm = "gpt-35-turbo" or "gpt-4(1106-Preview)",
but with "gpt-4(0613)", it returned this error:
Plain Text
BadRequestError: Error code: 400 - {'error': {'message': 'Unrecognized request arguments supplied: tool_choice, tools', 'type': 'invalid_request_error', 'param': None, 'code': None}}
3 comments
l
L
Hello everyone, can you help me with this issue?
For the same query to the same query_engine, normally it takes 10 seconds to response but sometime it takes 10mins to retry, why is that?
2 comments
l
T
Hi guys, is this a bug?
====
from llama_index.evaluation.dataset_generation import DatasetGenerator

questionGenerator = DatasetGenerator(nodes=nodes[:5], num_questions_per_chunk=1)

eval_questions = questionGenerator.generate_questions_from_nodes()
====
From my understanding, this should generate 5 questions ( 1 question each for 5 nodes). But it gives me 54 questions, seems like the default num_quetions_per_chunk=10

If I set num_questions_per_chunk=2, it works as expectation by generating 5 * 2 = 10 questions.
2 comments
l
j
Hi Guys, can someone please help me with this?
When running the multiDocumentAgentDemo, how can I track the sources of the response generated by the top_agent? Here the top_agent is a agent based on the index of multiple agents

tool_mapping = SimpleToolNodeMapping.from_objects(all_tools)
obj_index = ObjectIndex.from_objects(
all_tools,
tool_mapping,
VectorStoreIndex,
)

top_agent = FnRetrieverOpenAIAgent.from_retriever(
obj_index.as_retriever(similarity_top_k=3))

response = top_agent.query("question")
11 comments
l
W