Initialize the Crew AI instrumentor to enable automatic tracing.
from traceai_crewai import CrewAIInstrumentorCrewAIInstrumentor().instrument(tracer_provider=trace_provider)
5. Run Crew AI
Run your Crew AI application as you normally would. Our Instrumentor will automatically trace and send the telemetry data to our platform.
from crewai import LLM, Agent, Crew, Process, Taskfrom crewai_tools import SerperDevTooldef 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()