Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: GPTCache fully integrated with phidata #639

Open
KevinZhang19870314 opened this issue Aug 13, 2024 · 0 comments
Open

[Feature]: GPTCache fully integrated with phidata #639

KevinZhang19870314 opened this issue Aug 13, 2024 · 0 comments

Comments

@KevinZhang19870314
Copy link

Is your feature request related to a problem? Please describe.

I faced a problem with phidata when using GPTCache. I can't integarate GPTCache with phidata.

Describe the solution you'd like.

I can use the llm in GPTCache and passed it in phidata. Example below:

from phi.assistant import Assistant
from phi.llm.openai import OpenAIChat
from phi.tools.yfinance import YFinanceTools
from gptcache import cache
from gptcache.adapter import openai

assistant = Assistant(
    cache=cache.init(), # this line for cache
    llm=openai(model="gpt-4o"),  # this line for llm
    tools=[YFinanceTools(stock_price=True, analyst_recommendations=True, company_info=True, company_news=True)],
    show_tool_calls=True,
    markdown=True,
)
assistant.print_response("What is the stock price of NVDA")
assistant.print_response("Write a comparison between NVDA and AMD, use all tools available.")

Describe an alternate solution.

No response

Anything else? (Additional Context)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant