crewAIInc / crewAI

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
https://crewai.com
MIT License
18.97k stars 2.61k forks source link

OpenAI assistants #677

Closed ezequiroga closed 3 weeks ago

ezequiroga commented 3 months ago

Hi, I would like to know if it possible to configure an Agent to use an OpenAI Assistant.

Thanks!

gadgethome commented 3 months ago

Hi, do you mean a gpt you have built?

rapcal commented 3 months ago

You should probably build a custom tool that interacts with the assistant

ezequiroga commented 3 months ago

Hi guys, exactly. I have my own Assistant in OpenAI Platform with an specific domain GPT and I would like to use it by the CrewAI agents, because it has specific domain knowledge.

rapcal commented 3 months ago

Hi guys, exactly. I have my own Assistant in OpenAI Platform with an specific domain GPT and I would like to use it by the CrewAI agents, because it has specific domain knowledge.

Yes - so just create a custom tool

from crewai_tools import BaseTool

class AssistantChatTool(BaseTool):
    name: str = "Assistant Chat Tool"
    description: str = "Talks to an OpenAI assistant with specific domain knowledge"

    def _run(self, query: str) -> str:
        # your code
github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

ezequiroga commented 3 weeks ago

Great, I'll do that.

Thank you!!!