Skip to content

Commit fd9b843

Browse files
committed
chore: change input variables
1 parent 1041a3c commit fd9b843

5 files changed

Lines changed: 51 additions & 51 deletions

File tree

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"query": "What is the company policy on travel spending? What is the price of GPUs in 2025? What is 5+6+7+8+(6*10)?",
3-
"add_data_to_index": false,
4-
"include_hitl": false
3+
"add_data_to_index": false
54
}

samples/generic-rag-agent/main.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import time
3+
from typing import Optional
34

45
from llama_index.core import get_response_synthesizer
56
from llama_index.core.agent import ReActAgent
@@ -45,7 +46,7 @@
4546

4647
class CustomStartEvent(StartEvent):
4748
query: str = ""
48-
add_data_to_index: bool = False
49+
add_data_to_index: Optional[bool] = False
4950

5051

5152
class QueryEvent(Event):
@@ -196,13 +197,13 @@ async def add_file_to_index(file_path, index_name, ingest_data):
196197

197198
print(f"Indexing {len(files)} file(s) from {files_directory} to index '{index_name}'...")
198199

199-
for i in range(len(files)):
200+
for i, file_name in enumerate(files):
200201
is_last_config = config_key == list(INDEX_CONFIGS.keys())[-1]
201202
is_last_file = i == len(files) - 1
202203
ingest_data = is_last_config and is_last_file
203204

204205
await add_file_to_index(
205-
os.path.join(files_directory, files[i]),
206+
os.path.join(files_directory, file_name),
206207
index_name,
207208
ingest_data,
208209
)
@@ -404,9 +405,11 @@ async def request_human_confirmation(
404405
print(ev.formatted_answer)
405406
print("="*80)
406407

408+
prompt_message = f"{ev.formatted_answer}\n\n{'='*80}\n\nIs this answer satisfactory? (yes/no or provide feedback): "
409+
407410
ctx.write_event_to_stream(
408411
InputRequiredEvent(
409-
prefix="\nIs this answer satisfactory? (yes/no or provide feedback): "
412+
prefix=prompt_message
410413
)
411414
)
412415

samples/generic-rag-agent/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "generic-rag-agent"
3-
version = "0.0.27"
3+
version = "0.0.29"
44
description = "A generic RAG agent that combines multiple knowledge bases with web search capabilities and MCP tool support"
55
authors = [{ name = "John Doe", email = "john.doe@myemail.com" }]
66
readme = { file = "README.md", content-type = "text/markdown" }

samples/generic-rag-agent/uipath.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,22 @@
22
"entryPoints": [
33
{
44
"filePath": "agent",
5-
"uniqueId": "739a1d4e-7100-49bb-a866-2daa4ed45b3f",
5+
"uniqueId": "e321d542-02cc-47d8-9e28-88b4b638c4d0",
66
"type": "agent",
77
"input": {
88
"type": "object",
99
"properties": {
1010
"query": {
11+
"default": "",
1112
"title": "Query",
1213
"type": "string"
1314
},
1415
"add_data_to_index": {
15-
"title": "Add Data To Index",
16-
"type": "boolean"
16+
"type": "boolean",
17+
"nullable": true
1718
}
1819
},
19-
"required": [
20-
"query",
21-
"add_data_to_index"
22-
]
20+
"required": []
2321
},
2422
"output": {
2523
"type": "object",
@@ -40,7 +38,7 @@
4038
"resources": [
4139
{
4240
"resource": "index",
43-
"key": "index_folder_path.index_name",
41+
"key": "index_name.index_folder_path",
4442
"value": {
4543
"name": {
4644
"defaultValue": "index_name",
@@ -61,7 +59,7 @@
6159
},
6260
{
6361
"resource": "index",
64-
"key": "index_folder_path.index_name",
62+
"key": "index_name.index_folder_path",
6563
"value": {
6664
"name": {
6765
"defaultValue": "index_name",

0 commit comments

Comments
 (0)