Hi Phidata community!
I’m working on a Streamlit app that uses Phidata agents, and I’m running into a NotImplementedError when trying to use the async functionality. Here’s my current setup:
Agent Configuration:
from phi.agent import Agent
from phi.model.anthropic import Claude
from phi.tools.yfinance import YFinanceTools
finance_agent = Agent(
name="Finance Agent",
model=Claude(id=CLAUDE_MODEL_ID, api_key=ANTHROPIC_API_KEY, temperature=0.1),
tools=[YFinanceTools(stock_price=True, analyst_recommendations=True],
instructions=["Use tables to display data."],
show_tool_calls=True,
markdown=True,
)
Streamlit Async Implementation:
async def main():
if prompt := st.chat_input("Type your message here..."):
st.session_state.messages.append({"role": "user", "content": prompt})
display_message(st.session_state.messages[-1])
response = await st.session_state.current_agent.arun(prompt)
st.session_state.messages.append({"role": "assistant", "content": response})
display_message(st.session_state.messages[-1])
When trying to run this, I get a NotImplementedError from the base model when calling arun(). Do I need to configure the Claude model differently for async operations?