First working implementation of the program

This commit is contained in:
2026-07-27 17:42:48 +09:00
parent 9f9c72e824
commit e5bb49a596
12 changed files with 618 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
from langsmith import traceable
from agent_workflows.crew_setup import create_crew
from shared_config import AgenticAIConfig, logger
from langsmith.integrations.otel import OtelSpanProcessor
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.instrumentation.crewai import CrewAIInstrumentor
from opentelemetry.instrumentation.openai import OpenAIInstrumentor
# Initialize the trace provider
tracer_provider = TracerProvider()
#trace.set_tracer_provider(tracer_provider)
# Add the LangSmith OTel processor
tracer_provider.add_span_processor(OtelSpanProcessor())
# Instrument both CrewAI and OpenAI layers
CrewAIInstrumentor().instrument(tracer_provider=tracer_provider)
OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)
@traceable(name="Capstone_GTM Strategy Simulation", run_type="chain")
def runAgenticWorkflow(config: AgenticAIConfig):
"""
Main Entry Point of Agentic AI Workflow
"""
logger.info("Agentic Workflow Started...")
crew = create_crew(config)
result = crew.kickoff(
inputs={
"query": config.user_query
}
)
config.response = str(result)
return config