fix: Fix async/await and add_text issues in unified examples

- Remove incorrect await from chat.ask() calls (not async)
- Fix add_texts -> add_text method calls
- Verify search-complexity correctly maps to efSearch parameter
- All examples now run successfully
This commit is contained in:
Andy Lee
2025-07-29 16:00:58 -07:00
parent 9d77175ac8
commit ce77eef13a
2 changed files with 4 additions and 12 deletions

View File

@@ -195,9 +195,7 @@ class BaseRAGExample(ABC):
if not query:
continue
response = await chat.ask(
query, top_k=args.top_k, complexity=args.search_complexity
)
response = chat.ask(query, top_k=args.top_k, complexity=args.search_complexity)
print(f"\nAssistant: {response}\n")
except KeyboardInterrupt:
@@ -215,7 +213,7 @@ class BaseRAGExample(ABC):
)
print(f"\n[Query] {query}")
response = await chat.ask(query, top_k=args.top_k, complexity=args.search_complexity)
response = chat.ask(query, top_k=args.top_k, complexity=args.search_complexity)
print(f"\n[Response] {response}\n")
async def run(self):