stop_after_delay_seconds
from llama_index.core.agent.workflow import FunctionAgent, AgentWorkflow from llama_index.llms.vllm import Vllm from prompts import ( ORCHESTRATOR_SYSTEM_PROMPT, NOTION_SYSTEM_PROMPT, IMPLEMENTATION_SYSTEM_PROMPT, ) from tools import notion_retrieval_tool, implementation_tool llm = Vllm( model="model_name", tensor_parallel_size=4, max_new_tokens=100, vllm_kwargs={"swap_space": 1, "gpu_memory_utilization": 0.5}, ) orchestrator_agent = FunctionAgent( name="OrchestratorAgent", description=( "You are the OrchestratorAgent responsible for coordinating tasks between multiple agents. " ), system_prompt=ORCHESTRATOR_SYSTEM_PROMPT, llm=llm, tools=[], can_handoff_to=["NotionAgent", "ImplementationAgent"], )
llama_index.core.workflow.errors.WorkflowRuntimeError: Error in step 'struct': Expected at least one tool call, but got 0 tool calls.
class UserInfo(BaseModel): """ Output containing the response. Structured information about the person. """ name: str = Field(title="Full Name", description="Full name of the person") sllm = llm_gemini.as_structured_llm(UserInfo) query_engine = index.as_query_engine(doc_ids=doc_ids, use_async=True, llm=sllm) answer = await query_engine.aquery( """ Based on the context, generate a structured summary of the person. """ )
_postprocess_nodes
inside of LLMRerank where it gives priority to nodes with a more recent date and a specific subtype. However, since llm_rerank.py
is directly part of a Python package, I'm having trouble with utilizing the modified file instead of the original version of LLM rerank. Is there either a way to make these same node reranking adjustments in my workflow file or override the original package with my new code? Here is my updated section of the code:for node, relevance in zip(choice_nodes, relevances): # date score date_str = node.metadata.get('date') date_score = datetime.strptime(date_str, "%Y-%m-%d").timestamp() # Subtype score subtype = node.metadata.get('subtype', '') subtype_score = 1.0 if subtype == "pro report" else 0.0 node_score = relevance + date_score + subtype_score initial_results.append(NodeWithScore(node=node, score=node_score))
async for event in handler.stream_events(): if isinstance(event, AgentStream): message = ChatMessage(role="bot", type="delta", content=event.delta) await websocket.send_json(message.model_dump()) ...
ValueError: Model name Qwen/Qwen2.5-3B does not support function calling API.
dumps_kwargs
keyword arguments are no longer supported.doc_id
as a field in the metadata for LlamaIndex document and that will help dedupe but how will that work if document is say 1000 pages i.e. the document is broken into multiple nodes. How does doc_id
translate to multiple node
identifier to identify which node to update in MongoDB docstore and Qdrant vector store?node_id
directly then any guidance into how to generate node_id will be super helpful.