crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

OpenAI assistants

Open ezequiroga opened this issue 2 years ago • 6 comments

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

Thanks!

ezequiroga avatar May 22 '24 21:05 ezequiroga

Hi, do you mean a gpt you have built?

gadgethome avatar May 31 '24 17:05 gadgethome

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

rapcal avatar Jun 07 '24 04:06 rapcal

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.

ezequiroga avatar Jun 07 '24 04:06 ezequiroga

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

rapcal avatar Jun 07 '24 12:06 rapcal

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.

github-actions[bot] avatar Aug 17 '24 12:08 github-actions[bot]

Great, I'll do that.

Thank you!!!

ezequiroga avatar Aug 17 '24 12:08 ezequiroga