Integrating TaskigAI with CrewAI

I am using crewAI to build a tool and Tasking AI as the LLM provider.

Unfortunately, there is no direct way to integrate these two. Because crewAI needs an LLM model name and host address (if localhost) or uses langchain tools.

I have hit a wall where there is no way to integrate these two great tools.

Has anyone encountered this? Or is there any way to integrate these two tools?

Good news, we’ll soon release features that allow CrewAI x TaskingAI integration. Example cookbook is on the way now :slight_smile:

Good to hear that. CrewAI is surely a popular choice among the developers.

How’s the progress of this CrewAI x TaskingAI integration? thx.

Hi Alex, the integration of CrewAI x TaskingAI is now available through TaskingAI’s OpenAI-Compatible API. For information about the API, please refer to: TaskingAI Blog | Easier Integration with TaskingAI: Leveraging its New OpenAI-Compatible API

For a quick answer of using your TaskingAI assistant as your CrewAI model, simply set the environment variables as follows:

os.environ["OPENAI_API_BASE"] = 'https://oapi.tasking.ai/v1'
os.environ["OPENAI_MODEL_NAME"] ='YOUR_TASKINGAI_ASSISTANT_OR_MODEL_ID' 
os.environ["OPENAI_API_KEY"] ='YOUR_TASKINGAI_API_KEY'

You can use either your TaskingAI Model ID or Assistant ID as the model name.

Great question Alex. If you would like to have your agents in CrewAI with different TaskingAI assistants, you can use the help of langchain. Since the endpoint of https://oapi.tasking.ai is now openai-compatible, it will fit in any third-party SDKs that supports openai.

Example:

from langchain_openai import ChatOpenAI

os.environ["OPENAI_API_KEY"] = "YOUR_TASKINGAI_API_KEY"

llm1 = ChatOpenAI(
    model="YOUR_TASKINGAI_ASSISTANT_ID_1",
    base_url="https://oapi.tasking.ai/v1"
)

llm2 = ChatOpenAI(
    model="YOUR_TASKINGAI_ASSISTANT_ID_2",
    base_url="https://oapi.tasking.ai/v1"
)

agent1 = Agent(
  ...other configs
  llm=llm1
)

agent2 = Agent(
  ...other configs
  llm=llm2
)


1 Like