ragaai-catalyst 2.1.5.1b3__tar.gz → 2.1.6b1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/.gitignore +1 -0
- {ragaai_catalyst-2.1.5.1b3/ragaai_catalyst.egg-info → ragaai_catalyst-2.1.6b1}/PKG-INFO +14 -13
- ragaai_catalyst-2.1.6b1/examples/autogen/crisis_response_coordinator/OAI_CONFIG_LIST.json +6 -0
- ragaai_catalyst-2.1.6b1/examples/autogen/crisis_response_coordinator/crisis_response_coordinator.py +192 -0
- ragaai_catalyst-2.1.6b1/examples/autogen/crisis_response_coordinator/requirements.txt +1 -0
- ragaai_catalyst-2.1.6b1/examples/autogen/crisis_response_coordinator/sample.env +7 -0
- ragaai_catalyst-2.1.6b1/examples/crewai/scifi_writer/requirements.txt +2 -0
- ragaai_catalyst-2.1.6b1/examples/crewai/scifi_writer/sample.env +1 -0
- ragaai_catalyst-2.1.6b1/examples/crewai/scifi_writer/scifi_writer.py +101 -0
- {ragaai_catalyst-2.1.5.1b3/examples → ragaai_catalyst-2.1.6b1/examples/custom_agents}/travel_agent/config.py +5 -5
- {ragaai_catalyst-2.1.5.1b3/examples → ragaai_catalyst-2.1.6b1/examples/custom_agents}/travel_agent/main.py +1 -6
- ragaai_catalyst-2.1.6b1/examples/haystack/rag/rag.py +92 -0
- ragaai_catalyst-2.1.6b1/examples/haystack/rag/requirements.txt +3 -0
- ragaai_catalyst-2.1.6b1/examples/haystack/rag/sample.env +1 -0
- ragaai_catalyst-2.1.6b1/examples/langchain/medical_rag/data/medical_texts/handbook1.pdf +0 -0
- ragaai_catalyst-2.1.6b1/examples/langchain/medical_rag/data/medical_texts/handbook2.pdf +70 -0
- ragaai_catalyst-2.1.6b1/examples/langchain/medical_rag/data/symptom_disease_map.csv +9 -0
- ragaai_catalyst-2.1.6b1/examples/langchain/medical_rag/diagnosis_agent.py +151 -0
- ragaai_catalyst-2.1.6b1/examples/langchain/medical_rag/requirements.txt +7 -0
- ragaai_catalyst-2.1.6b1/examples/langchain/medical_rag/sample.env +1 -0
- ragaai_catalyst-2.1.6b1/examples/langgraph/personal_research_assistant/requirements.txt +3 -0
- ragaai_catalyst-2.1.6b1/examples/langgraph/personal_research_assistant/research_assistant.py +212 -0
- ragaai_catalyst-2.1.6b1/examples/langgraph/personal_research_assistant/sample.env +12 -0
- ragaai_catalyst-2.1.6b1/examples/llamaindex_examples/legal_research_rag/legal_data/cases/ca_overtime_2021.pdf +0 -0
- ragaai_catalyst-2.1.6b1/examples/llamaindex_examples/legal_research_rag/legal_data/cases/fl_ada_2022.pdf +85 -0
- ragaai_catalyst-2.1.6b1/examples/llamaindex_examples/legal_research_rag/legal_data/statutes.csv +3 -0
- ragaai_catalyst-2.1.6b1/examples/llamaindex_examples/legal_research_rag/legal_rag.py +98 -0
- ragaai_catalyst-2.1.6b1/examples/llamaindex_examples/legal_research_rag/requirements.txt +6 -0
- ragaai_catalyst-2.1.6b1/examples/llamaindex_examples/legal_research_rag/sample.env +1 -0
- ragaai_catalyst-2.1.6b1/examples/smolagents/most_upvoted_paper/README.md +12 -0
- ragaai_catalyst-2.1.6b1/examples/smolagents/most_upvoted_paper/most_upvoted_paper.py +146 -0
- ragaai_catalyst-2.1.6b1/examples/smolagents/most_upvoted_paper/requirements.txt +7 -0
- ragaai_catalyst-2.1.6b1/examples/smolagents/most_upvoted_paper/sample.env +2 -0
- ragaai_catalyst-2.1.6b1/examples/smolagents/rag_using_chromadb/README.md +60 -0
- ragaai_catalyst-2.1.6b1/examples/smolagents/rag_using_chromadb/rag_using_chromadb.py +114 -0
- ragaai_catalyst-2.1.6b1/examples/smolagents/rag_using_chromadb/requirements.txt +9 -0
- ragaai_catalyst-2.1.6b1/examples/smolagents/rag_using_chromadb/sample.env +5 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/pyproject.toml +14 -13
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/synthetic_data_generation.py +3 -2
- ragaai_catalyst-2.1.6b1/ragaai_catalyst/tracers/agentic_tracing/tracers/__init__.py +0 -0
- ragaai_catalyst-2.1.6b1/ragaai_catalyst/tracers/agentic_tracing/tracers/langgraph_tracer.py +0 -0
- ragaai_catalyst-2.1.6b1/ragaai_catalyst/tracers/agentic_tracing/upload/__init__.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/upload/trace_uploader.py +1 -1
- ragaai_catalyst-2.1.6b1/ragaai_catalyst/tracers/agentic_tracing/utils/trace_utils.py +436 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/exporters/ragaai_trace_exporter.py +5 -6
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/tracer.py +185 -30
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/utils/trace_json_converter.py +37 -5
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1/ragaai_catalyst.egg-info}/PKG-INFO +14 -13
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst.egg-info/SOURCES.txt +53 -49
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst.egg-info/requires.txt +13 -12
- ragaai_catalyst-2.1.6b1/tests/examples/langgraph/personal_research_assistant/test_research_assistant.py +203 -0
- ragaai_catalyst-2.1.5.1b3/examples/FinancialAnalysisSystem.ipynb +0 -311
- ragaai_catalyst-2.1.5.1b3/examples/TravelPlanner.ipynb +0 -491
- ragaai_catalyst-2.1.5.1b3/examples/agentic_rag.py +0 -320
- ragaai_catalyst-2.1.5.1b3/examples/custom_tracer_example.py +0 -125
- ragaai_catalyst-2.1.5.1b3/examples/customer_support.py +0 -556
- ragaai_catalyst-2.1.5.1b3/examples/finance.py +0 -161
- ragaai_catalyst-2.1.5.1b3/examples/langgraph_examples/agentic_rag.py +0 -318
- ragaai_catalyst-2.1.5.1b3/examples/langgraph_examples/customer_support.py +0 -551
- ragaai_catalyst-2.1.5.1b3/examples/langgraph_examples/multi_tool.py +0 -146
- ragaai_catalyst-2.1.5.1b3/examples/langgraph_examples/planning_agent.py +0 -193
- ragaai_catalyst-2.1.5.1b3/examples/langgraph_multi_tools.py +0 -148
- ragaai_catalyst-2.1.5.1b3/examples/llamaindex_examples/azureopenai_react_agent.py +0 -283
- ragaai_catalyst-2.1.5.1b3/examples/llamaindex_examples/function_calling_agent.ipynb +0 -459
- ragaai_catalyst-2.1.5.1b3/examples/llamaindex_examples/joke_gen_critique.py +0 -67
- ragaai_catalyst-2.1.5.1b3/examples/llamaindex_examples/joke_gen_critique_anthropic.py +0 -68
- ragaai_catalyst-2.1.5.1b3/examples/llamaindex_examples/joke_gen_critique_async.py +0 -106
- ragaai_catalyst-2.1.5.1b3/examples/llamaindex_examples/joke_gen_critique_azureopenai.py +0 -75
- ragaai_catalyst-2.1.5.1b3/examples/llamaindex_examples/joke_gen_critique_gemini.py +0 -68
- ragaai_catalyst-2.1.5.1b3/examples/llamaindex_examples/joke_gen_critique_litellm.py +0 -67
- ragaai_catalyst-2.1.5.1b3/examples/llamaindex_examples/joke_gen_critque_vertex.py +0 -70
- ragaai_catalyst-2.1.5.1b3/examples/llamaindex_examples/react_agent.ipynb +0 -530
- ragaai_catalyst-2.1.5.1b3/examples/llamaindex_examples/tool_call_agent.py +0 -132
- ragaai_catalyst-2.1.5.1b3/examples/planning_agent.py +0 -195
- ragaai_catalyst-2.1.5.1b3/examples/prompt_management_litellm.ipynb +0 -150
- ragaai_catalyst-2.1.5.1b3/examples/prompt_management_openai.ipynb +0 -151
- ragaai_catalyst-2.1.5.1b3/examples/sync_sample_call.py +0 -57
- ragaai_catalyst-2.1.5.1b3/ragaai_catalyst/tracers/agentic_tracing/utils/trace_utils.py +0 -65
- ragaai_catalyst-2.1.5.1b3/test/test_catalyst/autonomous_research_agent/.env.example +0 -8
- ragaai_catalyst-2.1.5.1b3/test/test_catalyst/autonomous_research_agent/agents/base_agent.py +0 -45
- ragaai_catalyst-2.1.5.1b3/test/test_catalyst/autonomous_research_agent/agents/coordinator.py +0 -97
- ragaai_catalyst-2.1.5.1b3/test/test_catalyst/autonomous_research_agent/agents/discovery.py +0 -269
- ragaai_catalyst-2.1.5.1b3/test/test_catalyst/autonomous_research_agent/agents/synthesis.py +0 -240
- ragaai_catalyst-2.1.5.1b3/test/test_catalyst/autonomous_research_agent/research_script.py +0 -133
- ragaai_catalyst-2.1.5.1b3/test/test_catalyst/autonomous_research_agent/utils/llm.py +0 -601
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/.gitmodules +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/LICENSE +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/README.md +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/dataset_management.md +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/img/autheticate.gif +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/img/create_project.gif +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/img/custom_metrics.png +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/img/dataset.gif +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/img/dataset.png +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/img/evaluation.gif +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/img/evaluation.png +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/img/guardrails.png +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/img/last_main.png +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/img/main.png +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/img/projects_new.png +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/img/trace_comp.png +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/prompt_management.md +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/docs/trace_management.md +0 -0
- /ragaai_catalyst-2.1.5.1b3/ragaai_catalyst/tracers/agentic_tracing/data/__init__.py → /ragaai_catalyst-2.1.6b1/examples/crewai/scifi_writer/README.md +0 -0
- {ragaai_catalyst-2.1.5.1b3/examples → ragaai_catalyst-2.1.6b1/examples/custom_agents}/travel_agent/agents.py +0 -0
- {ragaai_catalyst-2.1.5.1b3/examples → ragaai_catalyst-2.1.6b1/examples/custom_agents}/travel_agent/tools.py +0 -0
- /ragaai_catalyst-2.1.5.1b3/ragaai_catalyst/tracers/agentic_tracing/tests/__init__.py → /ragaai_catalyst-2.1.6b1/examples/haystack/rag/README.md +0 -0
- /ragaai_catalyst-2.1.5.1b3/ragaai_catalyst/tracers/agentic_tracing/tracers/__init__.py → /ragaai_catalyst-2.1.6b1/examples/langgraph/personal_research_assistant/README.md +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/__init__.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/_version.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/dataset.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/evaluation.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/experiment.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/guard_executor.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/guardrails_manager.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/internal_api_completion.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/prompt_manager.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/proxy_call.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/ragaai_catalyst.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming/__init__.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming/config/detectors.toml +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming/data_generator/scenario_generator.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming/data_generator/test_case_generator.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming/evaluator.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming/llm_generator.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming/llm_generator_old.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming/red_teaming.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming/requirements.txt +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming/tests/grok.ipynb +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming/tests/stereotype.ipynb +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming/upload_result.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming/utils/issue_description.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming/utils/rt.png +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/redteaming_old.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/__init__.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/README.md +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/__init__.py +0 -0
- {ragaai_catalyst-2.1.5.1b3/ragaai_catalyst/tracers/agentic_tracing/upload → ragaai_catalyst-2.1.6b1/ragaai_catalyst/tracers/agentic_tracing/data}/__init__.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/data/data_structure.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/tests/FinancialAnalysisSystem.ipynb +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/tests/GameActivityEventPlanner.ipynb +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/tests/TravelPlanner.ipynb +0 -0
- /ragaai_catalyst-2.1.5.1b3/ragaai_catalyst/tracers/agentic_tracing/tracers/langgraph_tracer.py → /ragaai_catalyst-2.1.6b1/ragaai_catalyst/tracers/agentic_tracing/tests/__init__.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/tests/ai_travel_agent.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/tests/unique_decorator_test.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/tracers/agent_tracer.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/tracers/base.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/tracers/custom_tracer.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/tracers/llm_tracer.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/tracers/main_tracer.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/tracers/network_tracer.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/tracers/tool_tracer.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/tracers/user_interaction_tracer.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/upload/upload_agentic_traces.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/upload/upload_code.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/upload/upload_local_metric.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/upload/upload_trace_metric.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/utils/__init__.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/utils/api_utils.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/utils/create_dataset_schema.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/utils/file_name_tracker.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/utils/generic.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/utils/get_user_trace_metrics.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/utils/llm_utils.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/utils/model_costs.json +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/utils/span_attributes.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/utils/supported_llm_provider.toml +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/utils/system_monitor.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/utils/unique_decorator.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/agentic_tracing/utils/zip_list_of_unique_files.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/distributed.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/exporters/__init__.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/exporters/dynamic_trace_exporter.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/exporters/file_span_exporter.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/exporters/raga_exporter.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/instrumentators/__init__.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/instrumentators/langchain.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/instrumentators/llamaindex.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/instrumentators/openai.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/langchain_callback.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/llamaindex_callback.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/llamaindex_instrumentation.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/upload_traces.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/utils/__init__.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/utils/convert_langchain_callbacks_output.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/utils/convert_llama_instru_callback.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/utils/extraction_logic_llama_index.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/utils/langchain_tracer_extraction_logic.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/utils/model_prices_and_context_window_backup.json +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/tracers/utils/utils.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst/utils.py +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst.egg-info/dependency_links.txt +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/ragaai_catalyst.egg-info/top_level.txt +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/requirements.txt +0 -0
- {ragaai_catalyst-2.1.5.1b3 → ragaai_catalyst-2.1.6b1}/setup.cfg +0 -0
- {ragaai_catalyst-2.1.5.1b3/test → ragaai_catalyst-2.1.6b1/tests}/test_catalyst/test_base_tracer_add_metrics.py +0 -0
- {ragaai_catalyst-2.1.5.1b3/test → ragaai_catalyst-2.1.6b1/tests}/test_catalyst/test_base_tracer_metrics.py +0 -0
- {ragaai_catalyst-2.1.5.1b3/test → ragaai_catalyst-2.1.6b1/tests}/test_catalyst/test_configuration.py +0 -0
- {ragaai_catalyst-2.1.5.1b3/test → ragaai_catalyst-2.1.6b1/tests}/test_catalyst/test_dataset.py +0 -0
- {ragaai_catalyst-2.1.5.1b3/test → ragaai_catalyst-2.1.6b1/tests}/test_catalyst/test_evaluation.py +0 -0
- {ragaai_catalyst-2.1.5.1b3/test → ragaai_catalyst-2.1.6b1/tests}/test_catalyst/test_evaluation_metrics.py +0 -0
- {ragaai_catalyst-2.1.5.1b3/test → ragaai_catalyst-2.1.6b1/tests}/test_catalyst/test_langchain_tracing.py +0 -0
- {ragaai_catalyst-2.1.5.1b3/test → ragaai_catalyst-2.1.6b1/tests}/test_catalyst/test_llm_providers.py +0 -0
- {ragaai_catalyst-2.1.5.1b3/test → ragaai_catalyst-2.1.6b1/tests}/test_catalyst/test_prompt_manager.py +0 -0
- {ragaai_catalyst-2.1.5.1b3/test → ragaai_catalyst-2.1.6b1/tests}/test_catalyst/test_redteaming.py +0 -0
- {ragaai_catalyst-2.1.5.1b3/test → ragaai_catalyst-2.1.6b1/tests}/test_catalyst/test_synthetic_data_generation.py +0 -0
- {ragaai_catalyst-2.1.5.1b3/test → ragaai_catalyst-2.1.6b1/tests}/test_catalyst/upload_trace_zip_automation.py +0 -0
@@ -1,32 +1,21 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ragaai_catalyst
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.6b1
|
4
4
|
Summary: RAGA AI CATALYST
|
5
5
|
Author-email: Kiran Scaria <kiran.scaria@raga.ai>, Kedar Gaikwad <kedar.gaikwad@raga.ai>, Dushyant Mahajan <dushyant.mahajan@raga.ai>, Siddhartha Kosti <siddhartha.kosti@raga.ai>, Ritika Goel <ritika.goel@raga.ai>, Vijay Chaurasia <vijay.chaurasia@raga.ai>, Tushar Kumar <tushar.kumar@raga.ai>
|
6
6
|
Requires-Python: <3.13,>=3.9
|
7
7
|
Description-Content-Type: text/markdown
|
8
8
|
License-File: LICENSE
|
9
9
|
Requires-Dist: aiohttp>=3.10.2
|
10
|
-
Requires-Dist: opentelemetry-api==1.25.0
|
11
|
-
Requires-Dist: opentelemetry-sdk==1.25.0
|
12
|
-
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc==1.25.0
|
13
|
-
Requires-Dist: opentelemetry-instrumentation==0.46b0
|
14
|
-
Requires-Dist: opentelemetry-instrumentation-fastapi==0.46b0
|
15
|
-
Requires-Dist: opentelemetry-instrumentation-asgi==0.46b0
|
16
|
-
Requires-Dist: opentelemetry-semantic-conventions==0.46b0
|
17
|
-
Requires-Dist: opentelemetry-util-http==0.46b0
|
18
|
-
Requires-Dist: opentelemetry-instrumentation-langchain~=0.24.0
|
19
|
-
Requires-Dist: opentelemetry-instrumentation-openai~=0.24.0
|
20
10
|
Requires-Dist: langchain-core>=0.2.11
|
21
11
|
Requires-Dist: langchain>=0.2.11
|
22
12
|
Requires-Dist: openai>=1.57.0
|
23
13
|
Requires-Dist: pandas
|
24
14
|
Requires-Dist: groq>=0.11.0
|
25
15
|
Requires-Dist: pypdf>=5.3.1
|
26
|
-
Requires-Dist: google-generativeai>=0.8.2
|
27
16
|
Requires-Dist: google-genai>=1.3.0
|
28
17
|
Requires-Dist: Markdown>=3.7
|
29
|
-
Requires-Dist: litellm
|
18
|
+
Requires-Dist: litellm>=1.51.1
|
30
19
|
Requires-Dist: tenacity==8.3.0
|
31
20
|
Requires-Dist: tqdm>=4.66.5
|
32
21
|
Requires-Dist: llama-index>=0.10.0
|
@@ -40,6 +29,18 @@ Requires-Dist: tiktoken>=0.7.0
|
|
40
29
|
Requires-Dist: tomli>=2.0.0
|
41
30
|
Requires-Dist: rich>=13.9.4
|
42
31
|
Requires-Dist: openinference-instrumentation-llama-index
|
32
|
+
Requires-Dist: openinference-instrumentation-langchain
|
33
|
+
Requires-Dist: openinference-instrumentation-vertexai
|
34
|
+
Requires-Dist: openinference-instrumentation-anthropic
|
35
|
+
Requires-Dist: openinference-instrumentation-groq
|
36
|
+
Requires-Dist: openinference-instrumentation-litellm
|
37
|
+
Requires-Dist: openinference-instrumentation-mistralai
|
38
|
+
Requires-Dist: openinference-instrumentation-openai
|
39
|
+
Requires-Dist: openinference-instrumentation-bedrock
|
40
|
+
Requires-Dist: openinference-instrumentation-crewai
|
41
|
+
Requires-Dist: openinference-instrumentation-haystack
|
42
|
+
Requires-Dist: openinference-instrumentation-autogen
|
43
|
+
Requires-Dist: openinference-instrumentation-smolagents
|
43
44
|
Requires-Dist: opentelemetry-sdk
|
44
45
|
Requires-Dist: opentelemetry-exporter-otlp
|
45
46
|
Requires-Dist: opentelemetry-proto>=1.12.0
|
ragaai_catalyst-2.1.6b1/examples/autogen/crisis_response_coordinator/crisis_response_coordinator.py
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
import os
|
2
|
+
import requests
|
3
|
+
import smtplib
|
4
|
+
from email.mime.text import MIMEText
|
5
|
+
from email.mime.multipart import MIMEMultipart
|
6
|
+
from autogen import AssistantAgent, UserProxyAgent, config_list_from_json
|
7
|
+
import datetime
|
8
|
+
from dotenv import load_dotenv
|
9
|
+
from ragaai_catalyst import RagaAICatalyst, init_tracing
|
10
|
+
from ragaai_catalyst.tracers import Tracer
|
11
|
+
|
12
|
+
|
13
|
+
catalyst = RagaAICatalyst(
|
14
|
+
access_key=os.getenv('CATALYST_ACCESS_KEY'),
|
15
|
+
secret_key=os.getenv('CATALYST_SECRET_KEY'),
|
16
|
+
base_url=os.getenv('CATALYST_BASE_URL')
|
17
|
+
)
|
18
|
+
# Initialize tracer
|
19
|
+
tracer = Tracer(
|
20
|
+
project_name=os.getenv('PROJECT_NAME'),
|
21
|
+
dataset_name=os.getenv('DATASET_NAME'),
|
22
|
+
tracer_type="agentic/autogen",
|
23
|
+
)
|
24
|
+
load_dotenv()
|
25
|
+
|
26
|
+
init_tracing(catalyst=catalyst, tracer=tracer)
|
27
|
+
|
28
|
+
config_list = config_list_from_json(
|
29
|
+
env_or_file="OAI_CONFIG_LIST.json",
|
30
|
+
file_location="examples/autogen/crisis_response_coordinator"
|
31
|
+
)
|
32
|
+
|
33
|
+
assistant = AssistantAgent(
|
34
|
+
name="Crisis_Coordinator",
|
35
|
+
system_message="You are a crisis response coordinator. Coordinate between news monitoring, resource mapping, and volunteer notification agents.",
|
36
|
+
llm_config={"config_list": config_list}
|
37
|
+
)
|
38
|
+
|
39
|
+
user_proxy = UserProxyAgent(
|
40
|
+
name="Admin",
|
41
|
+
human_input_mode="TERMINATE",
|
42
|
+
code_execution_config={"work_dir": "crisis"},
|
43
|
+
max_consecutive_auto_reply=20,
|
44
|
+
)
|
45
|
+
|
46
|
+
def extract_location(text: str) -> str:
|
47
|
+
"""Use LLM to extract location from text through dedicated sub-agents"""
|
48
|
+
if not text:
|
49
|
+
return "Unknown location"
|
50
|
+
|
51
|
+
location_assistant = AssistantAgent(
|
52
|
+
name="Location_Expert",
|
53
|
+
system_message="You are a geography expert. Extract ONLY the primary location name from text. Respond ONLY with the location.",
|
54
|
+
llm_config={"config_list": config_list}
|
55
|
+
)
|
56
|
+
|
57
|
+
location_user = UserProxyAgent(
|
58
|
+
name="Location_User",
|
59
|
+
human_input_mode="NEVER",
|
60
|
+
code_execution_config=False,
|
61
|
+
max_consecutive_auto_reply=0
|
62
|
+
)
|
63
|
+
|
64
|
+
try:
|
65
|
+
location_user.initiate_chat(
|
66
|
+
location_assistant,
|
67
|
+
message=f"Extract the primary geographic location from this news content. Respond ONLY with the location name:\n{text}"
|
68
|
+
)
|
69
|
+
|
70
|
+
last_message = location_assistant.last_message()["content"]
|
71
|
+
return last_message.strip(" .").split(",")[0] # Take primary location
|
72
|
+
except Exception as e:
|
73
|
+
print(f"Location extraction error: {str(e)}")
|
74
|
+
return "Unknown location"
|
75
|
+
|
76
|
+
@assistant.register_for_llm(name="monitor_disasters")
|
77
|
+
@user_proxy.register_for_execution(name="monitor_disasters")
|
78
|
+
def monitor_disasters(keywords: list = ["earthquake", "flood", "wildfire"]):
|
79
|
+
"""Monitor news for disaster alerts using NewsAPI"""
|
80
|
+
try:
|
81
|
+
response = requests.get(
|
82
|
+
"https://newsapi.org/v2/everything",
|
83
|
+
params={
|
84
|
+
"q": " OR ".join(keywords),
|
85
|
+
"apiKey": os.getenv("NEWSAPI_KEY"),
|
86
|
+
"sortBy": "publishedAt",
|
87
|
+
"pageSize": 10
|
88
|
+
}
|
89
|
+
)
|
90
|
+
articles = response.json().get("articles", [])
|
91
|
+
|
92
|
+
disasters = []
|
93
|
+
for article in articles:
|
94
|
+
content = f"{article.get('title', '')} {article.get('description', '')} {article.get('content', '')}"
|
95
|
+
print(f"Extracting location from: {content}")
|
96
|
+
disasters.append({
|
97
|
+
"title": article["title"],
|
98
|
+
"description": article["description"],
|
99
|
+
"location": extract_location(content),
|
100
|
+
"publishedAt": article["publishedAt"]
|
101
|
+
})
|
102
|
+
return disasters
|
103
|
+
except Exception as e:
|
104
|
+
return f"Error monitoring disasters: {str(e)}"
|
105
|
+
|
106
|
+
|
107
|
+
@assistant.register_for_llm(name="map_resources")
|
108
|
+
@user_proxy.register_for_execution(name="map_resources")
|
109
|
+
def map_resources(location: str):
|
110
|
+
"""Find nearby emergency resources using OpenStreetMap"""
|
111
|
+
try:
|
112
|
+
geo_response = requests.get(
|
113
|
+
"https://api.opencagedata.com/geocode/v1/json",
|
114
|
+
params={"q": location, "key": os.getenv("OPENCAGE_KEY")}
|
115
|
+
)
|
116
|
+
coords = geo_response.json()["results"][0]["geometry"]
|
117
|
+
|
118
|
+
overpass_query = f"""
|
119
|
+
[out:json];
|
120
|
+
node[emergency](around:10000,{coords['lat']},{coords['lng']});
|
121
|
+
out body;
|
122
|
+
"""
|
123
|
+
osm_response = requests.post(
|
124
|
+
"https://overpass-api.de/api/interpreter",
|
125
|
+
data=overpass_query
|
126
|
+
)
|
127
|
+
|
128
|
+
resources = []
|
129
|
+
for item in osm_response.json().get("elements", []):
|
130
|
+
resources.append({
|
131
|
+
"name": item.get("tags", {}).get("name", "Unnamed Facility"),
|
132
|
+
"type": item["tags"].get("emergency", "unknown"),
|
133
|
+
"address": item["tags"].get("addr:street", "Address not available"),
|
134
|
+
"coordinates": (item["lat"], item["lon"])
|
135
|
+
})
|
136
|
+
return resources
|
137
|
+
except Exception as e:
|
138
|
+
return f"Error mapping resources: {str(e)}"
|
139
|
+
|
140
|
+
@assistant.register_for_llm(name="notify_volunteers")
|
141
|
+
@user_proxy.register_for_execution(name="notify_volunteers")
|
142
|
+
def notify_volunteers(disaster_info: dict, resources: list):
|
143
|
+
"""Send emergency alerts via email using SMTP"""
|
144
|
+
try:
|
145
|
+
msg = MIMEMultipart()
|
146
|
+
msg["Subject"] = f"Crisis Alert: {disaster_info['title']}"
|
147
|
+
msg["From"] = os.getenv("SMTP_EMAIL")
|
148
|
+
msg["To"] = ", ".join(os.getenv("VOLUNTEER_EMAILS").split(","))
|
149
|
+
|
150
|
+
html = f"""<h2>{disaster_info['title']}</h2>
|
151
|
+
<p><strong>Time:</strong> {disaster_info['publishedAt']}</p>
|
152
|
+
<p>{disaster_info['description']}</p>
|
153
|
+
<h3>Nearby Resources:</h3>
|
154
|
+
<ul>"""
|
155
|
+
|
156
|
+
for resource in resources[:5]: # Limit to top 5 results
|
157
|
+
map_link = f"https://www.openstreetmap.org/?mlat={resource['coordinates'][0]}&mlon={resource['coordinates'][1]}#map=16/{resource['coordinates'][0]}/{resource['coordinates'][1]}"
|
158
|
+
html += f"""
|
159
|
+
<li>
|
160
|
+
<strong>{resource['name']}</strong> ({resource['type']})<br>
|
161
|
+
{resource['address']}<br>
|
162
|
+
<a href="{map_link}">View on Map</a>
|
163
|
+
</li>"""
|
164
|
+
html += "</ul>"
|
165
|
+
|
166
|
+
msg.attach(MIMEText(html, "html"))
|
167
|
+
|
168
|
+
with smtplib.SMTP(os.getenv("SMTP_SERVER"), int(os.getenv("SMTP_PORT"))) as server:
|
169
|
+
server.starttls()
|
170
|
+
server.login(os.getenv("SMTP_EMAIL"), os.getenv("SMTP_PASSWORD"))
|
171
|
+
server.send_message(msg)
|
172
|
+
|
173
|
+
return "Alert sent successfully"
|
174
|
+
except Exception as e:
|
175
|
+
return f"Error sending notification: {str(e)}"
|
176
|
+
|
177
|
+
|
178
|
+
def main():
|
179
|
+
user_proxy.initiate_chat(
|
180
|
+
assistant,
|
181
|
+
message="""Monitor for disasters, map resources, and notify volunteers.
|
182
|
+
Use the functions in order: monitor_disasters -> map_resources -> notify_volunteers."""
|
183
|
+
)
|
184
|
+
|
185
|
+
if __name__ == "__main__":
|
186
|
+
try:
|
187
|
+
with tracer:
|
188
|
+
main()
|
189
|
+
except Exception as e:
|
190
|
+
print(f"Critical error: {str(e)}")
|
191
|
+
finally:
|
192
|
+
print(f"Crisis response cycle completed at {datetime.datetime.now()}")
|
@@ -0,0 +1 @@
|
|
1
|
+
ag2[openai]
|
@@ -0,0 +1 @@
|
|
1
|
+
OPENAI_API_KEY=your_openai_api_key
|
@@ -0,0 +1,101 @@
|
|
1
|
+
import sys
|
2
|
+
sys.path.append('.')
|
3
|
+
|
4
|
+
from ragaai_catalyst import RagaAICatalyst, init_tracing
|
5
|
+
from ragaai_catalyst.tracers import Tracer
|
6
|
+
|
7
|
+
import os
|
8
|
+
from dotenv import load_dotenv
|
9
|
+
from crewai import Agent, Task, Crew, Process
|
10
|
+
from crewai.tools import tool
|
11
|
+
from typing import Any
|
12
|
+
|
13
|
+
|
14
|
+
load_dotenv()
|
15
|
+
|
16
|
+
catalyst = RagaAICatalyst(
|
17
|
+
access_key=os.getenv('CATALYST_ACCESS_KEY'),
|
18
|
+
secret_key=os.getenv('CATALYST_SECRET_KEY'),
|
19
|
+
base_url=os.getenv('CATALYST_BASE_URL')
|
20
|
+
)
|
21
|
+
|
22
|
+
tracer = Tracer(
|
23
|
+
project_name=os.getenv('PROJECT_NAME'),
|
24
|
+
dataset_name=os.getenv('DATASET_NAME'),
|
25
|
+
tracer_type="agentic/crewai",
|
26
|
+
)
|
27
|
+
init_tracing(catalyst=catalyst, tracer=tracer)
|
28
|
+
|
29
|
+
@tool
|
30
|
+
def write_to_file(filename: str, content: str) -> str:
|
31
|
+
"""Write content to a file with the specified filename."""
|
32
|
+
with open(filename, "w") as f:
|
33
|
+
f.write(content)
|
34
|
+
return f"Content successfully written to {filename}"
|
35
|
+
|
36
|
+
brainstormer = Agent(
|
37
|
+
role="Idea Generator",
|
38
|
+
goal="Come up with a creative premise for a sci-fi story set in 2050",
|
39
|
+
backstory="You are a visionary thinker who loves crafting imaginative sci-fi concepts.",
|
40
|
+
verbose=True,
|
41
|
+
allow_delegation=False
|
42
|
+
)
|
43
|
+
|
44
|
+
outliner = Agent(
|
45
|
+
role="Story Outliner",
|
46
|
+
goal="Create a structured outline based on the brainstormed premise",
|
47
|
+
backstory="You are an expert at organizing ideas into compelling story frameworks.",
|
48
|
+
verbose=True,
|
49
|
+
allow_delegation=False
|
50
|
+
)
|
51
|
+
|
52
|
+
writer = Agent(
|
53
|
+
role="Story Writer",
|
54
|
+
goal="Write a short sci-fi story based on the outline and save it to a file",
|
55
|
+
backstory="You are a skilled writer with a flair for vivid sci-fi narratives.",
|
56
|
+
verbose=True,
|
57
|
+
tools=[write_to_file],
|
58
|
+
allow_delegation=False
|
59
|
+
)
|
60
|
+
|
61
|
+
brainstorm_task = Task(
|
62
|
+
description="Generate a unique sci-fi story premise set in 2050. Include a setting, main character, and conflict.",
|
63
|
+
expected_output="A one-paragraph premise (e.g., 'In 2050, on a floating city above Venus, a rogue AI engineer battles a sentient cloud threatening humanity').",
|
64
|
+
agent=brainstormer
|
65
|
+
)
|
66
|
+
|
67
|
+
outline_task = Task(
|
68
|
+
description="Take the premise and create a simple story outline with 3 sections: Beginning, Middle, End.",
|
69
|
+
expected_output="A bullet-point outline (e.g., '- Beginning: Engineer discovers the sentient cloud...').",
|
70
|
+
agent=outliner,
|
71
|
+
context=[brainstorm_task]
|
72
|
+
)
|
73
|
+
|
74
|
+
writing_task = Task(
|
75
|
+
description="""Write a short (300-500 word) sci-fi story based on the outline.
|
76
|
+
Then use the FileWriteTool to save it as 'sci_fi_story.md'.""",
|
77
|
+
expected_output="A markdown file containing the full story.",
|
78
|
+
agent=writer,
|
79
|
+
context=[outline_task]
|
80
|
+
)
|
81
|
+
|
82
|
+
crew = Crew(
|
83
|
+
agents=[brainstormer, outliner, writer],
|
84
|
+
tasks=[brainstorm_task, outline_task, writing_task],
|
85
|
+
process=Process.sequential,
|
86
|
+
verbose=True
|
87
|
+
)
|
88
|
+
|
89
|
+
print("Starting the CrewAI Story Generation process...")
|
90
|
+
|
91
|
+
result = crew.kickoff()
|
92
|
+
|
93
|
+
print("\nProcess completed! Final output:")
|
94
|
+
print(result)
|
95
|
+
|
96
|
+
try:
|
97
|
+
with open("sci_fi_story.md", "r") as file:
|
98
|
+
print("\nGenerated Story Content:")
|
99
|
+
print(file.read())
|
100
|
+
except FileNotFoundError:
|
101
|
+
print("Story file not found. Check the writer agent's execution.")
|
@@ -9,14 +9,14 @@ import uuid
|
|
9
9
|
|
10
10
|
def initialize_tracing():
|
11
11
|
catalyst = RagaAICatalyst(
|
12
|
-
access_key=os.getenv("
|
13
|
-
secret_key=os.getenv("
|
14
|
-
base_url=os.getenv("
|
12
|
+
access_key=os.getenv("CATALYST_ACCESS_KEY"),
|
13
|
+
secret_key=os.getenv("CATALYST_SECRET_KEY"),
|
14
|
+
base_url=os.getenv("CATALYST_BASE_URL"),
|
15
15
|
)
|
16
16
|
|
17
17
|
tracer = Tracer(
|
18
|
-
project_name="
|
19
|
-
dataset_name="
|
18
|
+
project_name=os.getenv("PROJECT_NAME"),
|
19
|
+
dataset_name=os.getenv("DATASET_NAME"),
|
20
20
|
tracer_type="Agentic",
|
21
21
|
)
|
22
22
|
|
@@ -9,15 +9,12 @@ from agents import ItineraryAgent
|
|
9
9
|
from config import initialize_tracing
|
10
10
|
from ragaai_catalyst import trace_agent, current_span
|
11
11
|
|
12
|
-
# Load environment variables
|
13
12
|
load_dotenv()
|
14
13
|
|
15
|
-
# Initialize distributed tracing
|
16
14
|
tracer = initialize_tracing()
|
17
15
|
|
18
|
-
@trace_agent(name="travel_agent"
|
16
|
+
@trace_agent(name="travel_agent")
|
19
17
|
def travel_agent():
|
20
|
-
# Add metrics for the main session
|
21
18
|
current_span().add_metrics(
|
22
19
|
name="travel_planning_session",
|
23
20
|
score=0.9,
|
@@ -83,7 +80,6 @@ def travel_agent():
|
|
83
80
|
print("\nPlanned Itinerary:")
|
84
81
|
print(itinerary)
|
85
82
|
|
86
|
-
# Currency conversion
|
87
83
|
budget_amount = float(preferences["Budget"].replace("$", "").replace(",", ""))
|
88
84
|
converted_budget = currency_converter_tool(budget_amount, "USD", "INR")
|
89
85
|
if converted_budget:
|
@@ -91,7 +87,6 @@ def travel_agent():
|
|
91
87
|
else:
|
92
88
|
print("\nCurrency conversion not available.")
|
93
89
|
|
94
|
-
# Generate travel summary
|
95
90
|
summary_prompt = f"""
|
96
91
|
Summarize the following travel plan:
|
97
92
|
|
@@ -0,0 +1,92 @@
|
|
1
|
+
import os
|
2
|
+
import urllib.request
|
3
|
+
from haystack import Pipeline
|
4
|
+
from haystack.document_stores.in_memory import InMemoryDocumentStore
|
5
|
+
from haystack.components.retrievers import InMemoryEmbeddingRetriever
|
6
|
+
from haystack.components.converters import TextFileToDocument
|
7
|
+
from haystack.components.preprocessors import DocumentCleaner, DocumentSplitter
|
8
|
+
from haystack.components.embedders import OpenAIDocumentEmbedder, OpenAITextEmbedder
|
9
|
+
from haystack.components.writers import DocumentWriter
|
10
|
+
from haystack.components.builders import PromptBuilder
|
11
|
+
from haystack.components.generators.chat import OpenAIChatGenerator
|
12
|
+
from haystack.dataclasses import ChatMessage
|
13
|
+
from haystack.components.builders import ChatPromptBuilder
|
14
|
+
|
15
|
+
from ragaai_catalyst import RagaAICatalyst, Tracer, init_tracing
|
16
|
+
|
17
|
+
from dotenv import load_dotenv
|
18
|
+
load_dotenv()
|
19
|
+
|
20
|
+
catalyst = RagaAICatalyst(
|
21
|
+
access_key=os.environ['CATALYST_ACCESS_KEY'],
|
22
|
+
secret_key=os.environ['CATALYST_SECRET_KEY'],
|
23
|
+
base_url=os.environ['CATALYST_BASE_URL']
|
24
|
+
)
|
25
|
+
|
26
|
+
tracer = Tracer(
|
27
|
+
project_name=os.environ['PROJECT_NAME'],
|
28
|
+
dataset_name=os.environ['DATASET_NAME'],
|
29
|
+
tracer_type="agentic/haystack",
|
30
|
+
)
|
31
|
+
|
32
|
+
init_tracing(catalyst=catalyst, tracer=tracer)
|
33
|
+
|
34
|
+
urllib.request.urlretrieve("https://archive.org/stream/leonardodavinci00brocrich/leonardodavinci00brocrich_djvu.txt",
|
35
|
+
"davinci.txt")
|
36
|
+
|
37
|
+
document_store = InMemoryDocumentStore()
|
38
|
+
|
39
|
+
text_file_converter = TextFileToDocument()
|
40
|
+
cleaner = DocumentCleaner()
|
41
|
+
splitter = DocumentSplitter()
|
42
|
+
embedder = OpenAIDocumentEmbedder()
|
43
|
+
writer = DocumentWriter(document_store)
|
44
|
+
|
45
|
+
indexing_pipeline = Pipeline()
|
46
|
+
indexing_pipeline.add_component("converter", text_file_converter)
|
47
|
+
indexing_pipeline.add_component("cleaner", cleaner)
|
48
|
+
indexing_pipeline.add_component("splitter", splitter)
|
49
|
+
indexing_pipeline.add_component("embedder", embedder)
|
50
|
+
indexing_pipeline.add_component("writer", writer)
|
51
|
+
|
52
|
+
indexing_pipeline.connect("converter.documents", "cleaner.documents")
|
53
|
+
indexing_pipeline.connect("cleaner.documents", "splitter.documents")
|
54
|
+
indexing_pipeline.connect("splitter.documents", "embedder.documents")
|
55
|
+
indexing_pipeline.connect("embedder.documents", "writer.documents")
|
56
|
+
indexing_pipeline.run(data={"sources": ["davinci.txt"]})
|
57
|
+
|
58
|
+
text_embedder = OpenAITextEmbedder()
|
59
|
+
retriever = InMemoryEmbeddingRetriever(document_store)
|
60
|
+
prompt_template = [
|
61
|
+
ChatMessage.from_user(
|
62
|
+
"""
|
63
|
+
Given these documents, answer the question.
|
64
|
+
Documents:
|
65
|
+
{% for doc in documents %}
|
66
|
+
{{ doc.content }}
|
67
|
+
{% endfor %}
|
68
|
+
Question: {{query}}
|
69
|
+
Answer:
|
70
|
+
"""
|
71
|
+
)
|
72
|
+
]
|
73
|
+
prompt_builder = ChatPromptBuilder(template=prompt_template)
|
74
|
+
llm = OpenAIChatGenerator()
|
75
|
+
|
76
|
+
rag_pipeline = Pipeline()
|
77
|
+
rag_pipeline.add_component("text_embedder", text_embedder)
|
78
|
+
rag_pipeline.add_component("retriever", retriever)
|
79
|
+
rag_pipeline.add_component("prompt_builder", prompt_builder)
|
80
|
+
rag_pipeline.add_component("llm", llm)
|
81
|
+
|
82
|
+
rag_pipeline.connect("text_embedder.embedding", "retriever.query_embedding")
|
83
|
+
rag_pipeline.connect("retriever.documents", "prompt_builder.documents")
|
84
|
+
rag_pipeline.connect("prompt_builder", "llm")
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
query = "How old was Leonardo when he died?"
|
89
|
+
result = rag_pipeline.run(data={"prompt_builder": {"query":query}, "text_embedder": {"text": query}})
|
90
|
+
|
91
|
+
|
92
|
+
print(result["llm"]["replies"][0].text)
|
@@ -0,0 +1 @@
|
|
1
|
+
OPENAI_API_KEY=your-api-key-here
|
Binary file
|
@@ -0,0 +1,70 @@
|
|
1
|
+
%PDF-1.3
|
2
|
+
3 0 obj
|
3
|
+
<</Type /Page
|
4
|
+
/Parent 1 0 R
|
5
|
+
/Resources 2 0 R
|
6
|
+
/Contents 4 0 R>>
|
7
|
+
endobj
|
8
|
+
4 0 obj
|
9
|
+
<</Filter /FlateDecode /Length 362>>
|
10
|
+
stream
|
11
|
+
x�u��N�@��<�)i��v�@,��v����;����2c��<\K�/�U���D>�~4��M�f"I��qӌ�,[�U��.DU�Q8��a�[k���N������I��"�Q�H��~R�$��/����ϥ%� �4��/�];�^K%�^/`d�Z.���N�`q����65�(י��SĽi�N��qԎ�����j�)V"���K�|�6J+���UV���Tw\k�ȿ�s6��%EYgɳёْ�S*V�(����� ݿ��6v�����{j��윖��sG�t�L��$;c�����\$��|*^�N��1�8`t�N��V�\���vK·�ߍ0�3���� �#��K��)�T
|
12
|
+
endstream
|
13
|
+
endobj
|
14
|
+
1 0 obj
|
15
|
+
<</Type /Pages
|
16
|
+
/Kids [3 0 R ]
|
17
|
+
/Count 1
|
18
|
+
/MediaBox [0 0 595.28 841.89]
|
19
|
+
>>
|
20
|
+
endobj
|
21
|
+
5 0 obj
|
22
|
+
<</Type /Font
|
23
|
+
/BaseFont /Helvetica
|
24
|
+
/Subtype /Type1
|
25
|
+
/Encoding /WinAnsiEncoding
|
26
|
+
>>
|
27
|
+
endobj
|
28
|
+
2 0 obj
|
29
|
+
<<
|
30
|
+
/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
31
|
+
/Font <<
|
32
|
+
/F1 5 0 R
|
33
|
+
>>
|
34
|
+
/XObject <<
|
35
|
+
>>
|
36
|
+
>>
|
37
|
+
endobj
|
38
|
+
6 0 obj
|
39
|
+
<<
|
40
|
+
/Producer (PyFPDF 1.7.2 http://pyfpdf.googlecode.com/)
|
41
|
+
/CreationDate (D:20250310170658)
|
42
|
+
>>
|
43
|
+
endobj
|
44
|
+
7 0 obj
|
45
|
+
<<
|
46
|
+
/Type /Catalog
|
47
|
+
/Pages 1 0 R
|
48
|
+
/OpenAction [3 0 R /FitH null]
|
49
|
+
/PageLayout /OneColumn
|
50
|
+
>>
|
51
|
+
endobj
|
52
|
+
xref
|
53
|
+
0 8
|
54
|
+
0000000000 65535 f
|
55
|
+
0000000519 00000 n
|
56
|
+
0000000702 00000 n
|
57
|
+
0000000009 00000 n
|
58
|
+
0000000087 00000 n
|
59
|
+
0000000606 00000 n
|
60
|
+
0000000806 00000 n
|
61
|
+
0000000915 00000 n
|
62
|
+
trailer
|
63
|
+
<<
|
64
|
+
/Size 8
|
65
|
+
/Root 7 0 R
|
66
|
+
/Info 6 0 R
|
67
|
+
>>
|
68
|
+
startxref
|
69
|
+
1018
|
70
|
+
%%EOF
|
@@ -0,0 +1,9 @@
|
|
1
|
+
symptom,disease,confidence
|
2
|
+
"headache,fever",influenza,0.82
|
3
|
+
"chest pain,heartburn",gerd,0.91
|
4
|
+
"throbbing headache,light sensitivity",migraine,0.76
|
5
|
+
"cough,fever,shortness of breath",pneumonia,0.68
|
6
|
+
"fatigue,loss of appetite",anemia,0.85
|
7
|
+
"abdominal pain,nausea,vomiting",appendicitis,0.79
|
8
|
+
"joint pain,rash,fever",dengue,0.88
|
9
|
+
"stomach pain,diarrhea",gastroenteritis,0.75
|