- Installation Install the traceAI and Crew packages
Integrations
Crew AI
Was this page helpful?
⌘I
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
pip install traceAI-crewai crewai crewai_tools
import os
os.environ["OPENAI_API_KEY"] = "your-openai-api-key"
os.environ["FI_API_KEY"] = "your-futureagi-api-key"
os.environ["FI_SECRET_KEY"] = "your-futureagi-secret-key"
from fi_instrumentation import register
from fi_instrumentation.fi_types import ProjectType
trace_provider = register(
project_type=ProjectType.OBSERVE,
project_name="crewai_project",
)
from traceai_crewai import CrewAIInstrumentor
CrewAIInstrumentor().instrument(tracer_provider=trace_provider)
from crewai import LLM, Agent, Crew, Process, Task
from crewai_tools import SerperDevTool
def story_example():
llm = LLM(
model="gpt-4",
temperature=0.8,
max_tokens=150,
top_p=0.9,
frequency_penalty=0.1,
presence_penalty=0.1,
stop=["END"],
seed=42,
)
writer = Agent(
role="Writer",
goal="Write creative stories",
backstory="You are a creative writer with a passion for storytelling",
allow_delegation=False,
llm=llm,
)
writing_task = Task(
description="Write a short story about a magical forest",
agent=writer,
expected_output="A short story about a magical forest",
)
crew = Crew(agents=[writer], tasks=[writing_task])
# Execute the crew
result = crew.kickoff()
print(result)
if __name__ == "__main__":
story_example()
Was this page helpful?