Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion samples/quickstart-llamacloud/main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import os

from dotenv import load_dotenv
from llama_cloud_services import LlamaCloudIndex
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.indices.managed.llama_cloud import LlamaCloudIndex
from llama_index.llms.openai import OpenAI
from pydantic import BaseModel, Field

load_dotenv()

Expand Down Expand Up @@ -129,6 +130,12 @@ def get_travel_recommendation(query: str) -> str:
return f"Error generating travel recommendation: {str(e)}"


class AgentResponse(BaseModel):
response: str = Field(
description="The agent's response using available tools to search company policies and personal preferences"
)


# Create the FunctionAgent with our tools
agent = FunctionAgent(
tools=[
Expand All @@ -137,6 +144,7 @@ def get_travel_recommendation(query: str) -> str:
get_travel_recommendation,
],
llm=llm,
output_cls=AgentResponse,
system_prompt="""You are a helpful travel assistant that can search through company travel policies and personal preferences to provide comprehensive travel guidance.

You have access to three main functions:
Expand Down
4 changes: 2 additions & 2 deletions samples/quickstart-llamacloud/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = [{ name = "Tuana Celik", email = "tuana@runllama.ai" }]
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.10"
dependencies = [
"uipath-llamaindex>=0.0.33",
"uipath-llamaindex>=0.0.35",
"llama-index-llms-openai>=0.2.2",
"llama-cloud-services"
]
]
74 changes: 37 additions & 37 deletions samples/quickstart-llamacloud/uipath.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
{
"entryPoints": [
{
"filePath": "agent",
"uniqueId": "b2c345f2-86cd-4e4b-b2c0-625f64de97ec",
"type": "agent",
"input": {
"type": "object",
"properties": {
"user_msg": {
"title": "Travel Query",
"type": "string",
"description": "Your travel-related question or request (e.g., 'What are the travel rates for New York?', 'What are my travel preferences?', 'Give me travel recommendations for a business trip')"
}
},
"required": [
"query"
]
},
"output": {
"type": "object",
"properties": {
"response": {
"title": "Agent Response",
"type": "object",
"description": "The agent's response using available tools to search company policies and personal preferences"
}
},
"required": [
"response"
]
}
"entryPoints": [
{
"filePath": "agent",
"uniqueId": "20074c23-0e8a-462b-8a49-b3985a61c59c",
"type": "agent",
"input": {
"type": "object",
"properties": {
"user_msg": {
"type": "string",
"title": "Travel Query",
"description": "Your travel-related question or request (e.g., 'What are the travel rates for New York?', 'What are my travel preferences?', 'Give me travel recommendations for a business trip')"
}
},
"required": [
"user_msg"
]
},
"output": {
"type": "object",
"properties": {
"response": {
"description": "The agent's response using available tools to search company policies and personal preferences",
"title": "Response",
"type": "string"
}
},
"required": [
"response"
]
}
}
],
"bindings": {
"version": "2.0",
"resources": []
}
],
"bindings": {
"version": "2.0",
"resources": []
}
}
}
Loading
Loading