Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed May 2, 2024
1 parent 2075f58 commit 0ea4304
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions cookbook/assistants/web_search.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from phi.assistant import Assistant
from phi.tools.duckduckgo import DuckDuckGo

assistant = Assistant(tools=[DuckDuckGo()], show_tool_calls=True)
assistant.print_response("Whats happening in France?", markdown=True)
assistant = Assistant(tools=[DuckDuckGo()], show_tool_calls=True, monitoring=True, debug_mode=True)
assistant.print_response("Share 1 story from France?", markdown=True)
11 changes: 2 additions & 9 deletions phi/assistant/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,10 +866,6 @@ def _run(
self.write_to_storage()

# -*- Send run event for monitoring
event_info: Dict[str, Any] = {
"functions": self.llm.functions if self.llm else None,
"metrics": self.llm.metrics if self.llm else None,
}
# Response type for this run
llm_response_type = "text"
if self.output_model is not None:
Expand All @@ -882,11 +878,10 @@ def _run(
"response": llm_response,
"response_format": llm_response_type,
"messages": llm_messages,
"info": event_info,
"metrics": self.llm.metrics if self.llm else None,
# To be removed
"llm_response": llm_response,
"llm_response_type": llm_response_type,
"metrics": self.llm.metrics if self.llm else None,
}
self._api_log_assistant_event(event_type="run", event_data=event_data)

Expand Down Expand Up @@ -1061,7 +1056,6 @@ async def _arun(
self.write_to_storage()

# -*- Send run event for monitoring
event_info: Dict[str, Any] = {}
# Response type for this run
llm_response_type = "text"
if self.output_model is not None:
Expand All @@ -1074,11 +1068,10 @@ async def _arun(
"response": llm_response,
"response_format": llm_response_type,
"messages": llm_messages,
"info": event_info,
"metrics": self.llm.metrics if self.llm else None,
# To be removed
"llm_response": llm_response,
"llm_response_type": llm_response_type,
"metrics": self.llm.metrics if self.llm else None,
}
self._api_log_assistant_event(event_type="run", event_data=event_data)

Expand Down

0 comments on commit 0ea4304

Please sign in to comment.