Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,6 @@ import requests
|
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
|
| 7 |
-
from llama_index.core.workflow import Context
|
| 8 |
from llama_index.core.agent.workflow import AgentWorkflow
|
| 9 |
from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI
|
| 10 |
from youtube_tool import youtube_transcript_tool, youtube_transcript_snippet_tool
|
|
@@ -30,11 +29,10 @@ class BasicAgent:
|
|
| 30 |
[wikipedia_search_tool, youtube_transcript_tool, youtube_transcript_snippet_tool, round_to_two_decimals_tool, text_inverter_tool, google_web_search_tool],
|
| 31 |
llm=self.llm,
|
| 32 |
)
|
| 33 |
-
self.context = Context(self.llamaindex_agent)
|
| 34 |
def __call__(self, question: str) -> str:
|
| 35 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 36 |
#fixed_answer = "This is a default answer."
|
| 37 |
-
fixed_answer = self.llamaindex_agent.run(question
|
| 38 |
print(f"Agent returning fixed answer: {fixed_answer}")
|
| 39 |
return fixed_answer
|
| 40 |
|
|
|
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
|
|
|
|
| 7 |
from llama_index.core.agent.workflow import AgentWorkflow
|
| 8 |
from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI
|
| 9 |
from youtube_tool import youtube_transcript_tool, youtube_transcript_snippet_tool
|
|
|
|
| 29 |
[wikipedia_search_tool, youtube_transcript_tool, youtube_transcript_snippet_tool, round_to_two_decimals_tool, text_inverter_tool, google_web_search_tool],
|
| 30 |
llm=self.llm,
|
| 31 |
)
|
|
|
|
| 32 |
def __call__(self, question: str) -> str:
|
| 33 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 34 |
#fixed_answer = "This is a default answer."
|
| 35 |
+
fixed_answer = self.llamaindex_agent.run(question)
|
| 36 |
print(f"Agent returning fixed answer: {fixed_answer}")
|
| 37 |
return fixed_answer
|
| 38 |
|