ragaai-catalyst 2.2.5b1__tar.gz → 2.2.5b3__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.
Files changed (190) hide show
  1. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/.gitignore +3 -1
  2. {ragaai_catalyst-2.2.5b1/ragaai_catalyst.egg-info → ragaai_catalyst-2.2.5b3}/PKG-INFO +2 -1
  3. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/pyproject.toml +2 -1
  4. ragaai_catalyst-2.2.5b3/ragaai_catalyst/tracers/agentic_tracing/tracers/main_tracer.py +117 -0
  5. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/tracer.py +5 -2
  6. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3/ragaai_catalyst.egg-info}/PKG-INFO +2 -1
  7. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst.egg-info/requires.txt +1 -0
  8. ragaai_catalyst-2.2.5b1/ragaai_catalyst/tracers/agentic_tracing/tracers/main_tracer.py +0 -376
  9. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  10. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  11. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  12. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/.github/workflows/ci.yml +0 -0
  13. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/.gitmodules +0 -0
  14. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/LICENSE +0 -0
  15. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/Quickstart.md +0 -0
  16. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/README.md +0 -0
  17. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/agentic_tracing.md +0 -0
  18. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/dataset_management.md +0 -0
  19. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/img/autheticate.gif +0 -0
  20. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/img/create_project.gif +0 -0
  21. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/img/custom_metrics.png +0 -0
  22. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/img/dataset.gif +0 -0
  23. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/img/dataset.png +0 -0
  24. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/img/evaluation.gif +0 -0
  25. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/img/evaluation.png +0 -0
  26. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/img/guardrails.png +0 -0
  27. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/img/last_main.png +0 -0
  28. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/img/main.png +0 -0
  29. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/img/projects_new.png +0 -0
  30. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/img/trace_comp.png +0 -0
  31. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/prompt_management.md +0 -0
  32. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/docs/trace_management.md +0 -0
  33. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/all_llm_provider/all_llm_provider.py +0 -0
  34. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/all_llm_provider/config.py +0 -0
  35. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/all_llm_provider/run_all_llm_provider.py +0 -0
  36. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/crewai/scifi_writer/README.md +0 -0
  37. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/crewai/scifi_writer/requirements.txt +0 -0
  38. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/crewai/scifi_writer/sample.env +0 -0
  39. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/crewai/scifi_writer/scifi_writer.py +0 -0
  40. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/custom_agents/travel_agent/agents.py +0 -0
  41. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/custom_agents/travel_agent/config.py +0 -0
  42. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/custom_agents/travel_agent/main.py +0 -0
  43. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/custom_agents/travel_agent/tools.py +0 -0
  44. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/haystack/news_fetching/README.md +0 -0
  45. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/haystack/news_fetching/news_fetching.py +0 -0
  46. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/haystack/news_fetching/requirements.txt +0 -0
  47. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/langchain/medical_rag/data/medical_texts/handbook1.pdf +0 -0
  48. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/langchain/medical_rag/data/medical_texts/handbook2.pdf +0 -0
  49. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/langchain/medical_rag/data/symptom_disease_map.csv +0 -0
  50. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/langchain/medical_rag/diagnosis_agent.py +0 -0
  51. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/langchain/medical_rag/requirements.txt +0 -0
  52. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/langchain/medical_rag/sample.env +0 -0
  53. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/langgraph/personal_research_assistant/README.md +0 -0
  54. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/langgraph/personal_research_assistant/requirements.txt +0 -0
  55. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/langgraph/personal_research_assistant/research_assistant.py +0 -0
  56. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/langgraph/personal_research_assistant/sample.env +0 -0
  57. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/llamaindex_examples/legal_research_rag/legal_data/cases/ca_overtime_2021.pdf +0 -0
  58. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/llamaindex_examples/legal_research_rag/legal_data/cases/fl_ada_2022.pdf +0 -0
  59. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/llamaindex_examples/legal_research_rag/legal_data/statutes.csv +0 -0
  60. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/llamaindex_examples/legal_research_rag/legal_rag.py +0 -0
  61. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/llamaindex_examples/legal_research_rag/requirements.txt +0 -0
  62. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/llamaindex_examples/legal_research_rag/sample.env +0 -0
  63. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/openai_agents_sdk/email_data_extraction_agent/README.md +0 -0
  64. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/openai_agents_sdk/email_data_extraction_agent/data_extraction_email.py +0 -0
  65. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/openai_agents_sdk/email_data_extraction_agent/requirements.txt +0 -0
  66. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/openai_agents_sdk/email_data_extraction_agent/sample.env +0 -0
  67. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/openai_agents_sdk/youtube_summary_agent/README.md +0 -0
  68. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/openai_agents_sdk/youtube_summary_agent/requirements.txt +0 -0
  69. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/openai_agents_sdk/youtube_summary_agent/sample.env +0 -0
  70. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/openai_agents_sdk/youtube_summary_agent/youtube_summary_agent.py +0 -0
  71. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/pii_masking_example/llamaindex_agentic_fastapi/app.py +0 -0
  72. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/pii_masking_example/llamaindex_agentic_fastapi/app_presidio.py +0 -0
  73. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/pii_masking_example/llamaindex_agentic_fastapi/request.py +0 -0
  74. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/pii_masking_example/llamaindex_agentic_fastapi/requirements.txt +0 -0
  75. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/smolagents/most_upvoted_paper/README.md +0 -0
  76. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/smolagents/most_upvoted_paper/most_upvoted_paper.py +0 -0
  77. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/smolagents/most_upvoted_paper/requirements.txt +0 -0
  78. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/examples/smolagents/most_upvoted_paper/sample.env +0 -0
  79. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/__init__.py +0 -0
  80. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/_version.py +0 -0
  81. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/dataset.py +0 -0
  82. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/evaluation.py +0 -0
  83. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/guard_executor.py +0 -0
  84. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/guardrails_manager.py +0 -0
  85. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/internal_api_completion.py +0 -0
  86. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/prompt_manager.py +0 -0
  87. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/proxy_call.py +0 -0
  88. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/ragaai_catalyst.py +0 -0
  89. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming/__init__.py +0 -0
  90. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming/config/detectors.toml +0 -0
  91. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming/data_generator/scenario_generator.py +0 -0
  92. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming/data_generator/test_case_generator.py +0 -0
  93. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming/evaluator.py +0 -0
  94. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming/llm_generator.py +0 -0
  95. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming/llm_generator_old.py +0 -0
  96. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming/red_teaming.py +0 -0
  97. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming/requirements.txt +0 -0
  98. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming/tests/grok.ipynb +0 -0
  99. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming/tests/stereotype.ipynb +0 -0
  100. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming/upload_result.py +0 -0
  101. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming/utils/issue_description.py +0 -0
  102. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming/utils/rt.png +0 -0
  103. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/redteaming_old.py +0 -0
  104. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/synthetic_data_generation.py +0 -0
  105. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/__init__.py +0 -0
  106. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/README.md +0 -0
  107. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/__init__.py +0 -0
  108. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/data/__init__.py +0 -0
  109. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/data/data_structure.py +0 -0
  110. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/tracers/__init__.py +0 -0
  111. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/upload/__init__.py +0 -0
  112. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/upload/trace_uploader.py +0 -0
  113. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/upload/upload_agentic_traces.py +0 -0
  114. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/upload/upload_code.py +0 -0
  115. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/utils/__init__.py +0 -0
  116. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/utils/create_dataset_schema.py +0 -0
  117. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/utils/file_name_tracker.py +0 -0
  118. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/utils/llm_utils.py +0 -0
  119. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/utils/model_costs.json +0 -0
  120. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/utils/system_monitor.py +0 -0
  121. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/utils/trace_utils.py +0 -0
  122. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/utils/unique_decorator.py +0 -0
  123. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/agentic_tracing/utils/zip_list_of_unique_files.py +0 -0
  124. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/distributed.py +0 -0
  125. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/exporters/__init__.py +0 -0
  126. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/exporters/dynamic_trace_exporter.py +0 -0
  127. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/exporters/file_span_exporter.py +0 -0
  128. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/exporters/ragaai_trace_exporter.py +0 -0
  129. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/instrumentators/__init__.py +0 -0
  130. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/utils/__init__.py +0 -0
  131. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/utils/model_prices_and_context_window_backup.json +0 -0
  132. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/utils/rag_extraction_logic_final.py +0 -0
  133. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/utils/trace_json_converter.py +0 -0
  134. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/tracers/utils/utils.py +0 -0
  135. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst/utils.py +0 -0
  136. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst.egg-info/SOURCES.txt +0 -0
  137. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst.egg-info/dependency_links.txt +0 -0
  138. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/ragaai_catalyst.egg-info/top_level.txt +0 -0
  139. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/requirements.txt +0 -0
  140. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/setup.cfg +0 -0
  141. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/test_report_20250407_183101.txt +0 -0
  142. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/README.md +0 -0
  143. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/environment.yml +0 -0
  144. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/__init__.py +0 -0
  145. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/all_llm_provider/all_llm_provider.py +0 -0
  146. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/all_llm_provider/config.py +0 -0
  147. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/all_llm_provider/test_all_llm_provider.py +0 -0
  148. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/crewai/scifi_writer/sci_fi_story.md +0 -0
  149. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/crewai/scifi_writer/scifi_writer.py +0 -0
  150. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/crewai/scifi_writer/test_scifi_writer.py +0 -0
  151. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/custom_agents/travel_agent/agents.py +0 -0
  152. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/custom_agents/travel_agent/config.py +0 -0
  153. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/custom_agents/travel_agent/main.py +0 -0
  154. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/custom_agents/travel_agent/test_travel_agent.py +0 -0
  155. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/custom_agents/travel_agent/tools.py +0 -0
  156. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/haystack/news_fetching/news_fetching.py +0 -0
  157. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/haystack/news_fetching/test_news_fetching.py +0 -0
  158. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/langchain/medical_rag/data/medical_texts/handbook1.pdf +0 -0
  159. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/langchain/medical_rag/data/medical_texts/handbook2.pdf +0 -0
  160. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/langchain/medical_rag/data/symptom_disease_map.csv +0 -0
  161. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/langchain/medical_rag/diagnosis_agent.py +0 -0
  162. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/langchain/medical_rag/test_diagnosis_agent.py +0 -0
  163. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/langgraph/personal_research_assistant/research_assistant.py +0 -0
  164. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/langgraph/personal_research_assistant/test_research_assistant.py +0 -0
  165. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/llamaindex_examples/legal_research_rag/legal_data/cases/ca_overtime_2021.pdf +0 -0
  166. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/llamaindex_examples/legal_research_rag/legal_data/cases/fl_ada_2022.pdf +0 -0
  167. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/llamaindex_examples/legal_research_rag/legal_data/statutes.csv +0 -0
  168. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/llamaindex_examples/legal_research_rag/legal_rag.py +0 -0
  169. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/llamaindex_examples/legal_research_rag/test_legal_rag.py +0 -0
  170. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/smolagents/most_upvoted_paper/most_upvoted_paper.py +0 -0
  171. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/smolagents/most_upvoted_paper/paper.pdf +0 -0
  172. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/smolagents/most_upvoted_paper/test_most_upvoted_paper.py +0 -0
  173. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/test_utils/get_components.py +0 -0
  174. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/examples/test_utils/get_trace_data.py +0 -0
  175. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/run_pytest_and_print_and_save_results.py +0 -0
  176. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/table_result.png +0 -0
  177. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/test_catalyst/test_base_tracer_add_metrics.py +0 -0
  178. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/test_catalyst/test_base_tracer_metrics.py +0 -0
  179. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/test_catalyst/test_data/util_synthetic_data_doc.pdf +0 -0
  180. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/test_catalyst/test_data/util_synthetic_data_invalid.csv +0 -0
  181. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/test_catalyst/test_data/util_synthetic_data_valid.csv +0 -0
  182. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/test_catalyst/test_data/util_test_dataset.csv +0 -0
  183. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/test_catalyst/test_data/util_test_langchain_tracing.pdf +0 -0
  184. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/test_catalyst/test_dataset.py +0 -0
  185. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/test_catalyst/test_evaluation.py +0 -0
  186. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/test_catalyst/test_evaluation_metrics.py +0 -0
  187. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/test_catalyst/test_prompt_manager.py +0 -0
  188. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/test_catalyst/test_synthetic_data_generation.py +0 -0
  189. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests/test_catalyst/test_the_configuration.py +0 -0
  190. {ragaai_catalyst-2.2.5b1 → ragaai_catalyst-2.2.5b3}/tests_requirements.txt +0 -0
@@ -229,4 +229,6 @@ direct_opanai.json
229
229
  new_feature_test.ipynb
230
230
  ex_google_adk.py
231
231
  multi_tool_agent/
232
- storyflow_agent.py
232
+ storyflow_agent.py
233
+ google_adk_agent_ex.py
234
+ Quickstart.md
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ragaai_catalyst
3
- Version: 2.2.5b1
3
+ Version: 2.2.5b3
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>, Rishabh Pandey <rishabh.pandey@raga.ai>, Jyotsana C G <jyotsana@raga.ai>
6
6
  Requires-Python: <=3.13.2,>=3.10
@@ -41,6 +41,7 @@ Requires-Dist: openinference-instrumentation-crewai
41
41
  Requires-Dist: openinference-instrumentation-haystack
42
42
  Requires-Dist: openinference-instrumentation-openai-agents
43
43
  Requires-Dist: openinference-instrumentation-smolagents
44
+ Requires-Dist: openinference-instrumentation-google-adk
44
45
  Requires-Dist: opentelemetry-sdk
45
46
  Requires-Dist: opentelemetry-exporter-otlp
46
47
  Requires-Dist: opentelemetry-proto>=1.12.0
@@ -8,7 +8,7 @@ description = "RAGA AI CATALYST"
8
8
  readme = "README.md"
9
9
  requires-python = ">=3.10,<=3.13.2"
10
10
  # license = {file = "LICENSE"}
11
- version = "2.2.5.beta.1"
11
+ version = "2.2.5.beta.3"
12
12
  authors = [
13
13
  {name = "Kiran Scaria", email = "kiran.scaria@raga.ai"},
14
14
  {name = "Kedar Gaikwad", email = "kedar.gaikwad@raga.ai"},
@@ -57,6 +57,7 @@ dependencies = [
57
57
  "openinference-instrumentation-haystack",
58
58
  "openinference-instrumentation-openai-agents",
59
59
  "openinference-instrumentation-smolagents",
60
+ "openinference-instrumentation-google-adk",
60
61
  "opentelemetry-sdk",
61
62
  "opentelemetry-exporter-otlp",
62
63
  "opentelemetry-proto>=1.12.0",
@@ -0,0 +1,117 @@
1
+ import contextvars
2
+ from typing import Optional, Dict
3
+ import json
4
+ from datetime import datetime
5
+ import uuid
6
+ import os
7
+ import builtins
8
+ from pathlib import Path
9
+ import logging
10
+ logger = logging.getLogger(__name__)
11
+
12
+ from ..data.data_structure import (
13
+ Trace,
14
+ Metadata,
15
+ SystemInfo,
16
+ OSInfo,
17
+ EnvironmentInfo,
18
+ Resources,
19
+ CPUResource,
20
+ MemoryResource,
21
+ DiskResource,
22
+ NetworkResource,
23
+ ResourceInfo,
24
+ MemoryInfo,
25
+ DiskInfo,
26
+ NetworkInfo,
27
+ Component,
28
+ LLMComponent,
29
+ AgentComponent,
30
+ ToolComponent,
31
+ NetworkCall,
32
+ Interaction,
33
+ Error,
34
+ )
35
+
36
+ from ....ragaai_catalyst import RagaAICatalyst
37
+
38
+
39
+ class AgenticTracing():
40
+ def __init__(self, user_detail, auto_instrumentation=None, timeout=120):
41
+ self.project_name = user_detail["project_name"]
42
+ self.project_id = user_detail["project_id"]
43
+ self.trace_user_detail = user_detail["trace_user_detail"]
44
+ self.base_url = f"{RagaAICatalyst.BASE_URL}"
45
+ self.timeout = timeout
46
+
47
+ # Add warning flag
48
+ self._warning_shown = False
49
+
50
+ self.tools: Dict[str, Tool] = {}
51
+ self.call_depth = contextvars.ContextVar("call_depth", default=0)
52
+ self.current_component_id = contextvars.ContextVar(
53
+ "current_component_id", default=None
54
+ )
55
+
56
+ # Handle auto_instrumentation
57
+ if auto_instrumentation is None:
58
+ # Default behavior: everything enabled
59
+ self.is_active = True
60
+ self.auto_instrument_llm = True
61
+ self.auto_instrument_tool = True
62
+ self.auto_instrument_agent = True
63
+ self.auto_instrument_user_interaction = True
64
+ self.auto_instrument_file_io = True
65
+ self.auto_instrument_network = True
66
+ self.auto_instrument_custom = True
67
+ else:
68
+ # Set global active state
69
+ self.is_active = True
70
+
71
+ # Set individual components
72
+ if isinstance(auto_instrumentation, dict):
73
+ self.auto_instrument_llm = auto_instrumentation.get("llm", True)
74
+ self.auto_instrument_tool = auto_instrumentation.get("tool", True)
75
+ self.auto_instrument_agent = auto_instrumentation.get("agent", True)
76
+ self.auto_instrument_user_interaction = auto_instrumentation.get(
77
+ "user_interaction", True
78
+ )
79
+ self.auto_instrument_file_io = auto_instrumentation.get(
80
+ "file_io", True
81
+ )
82
+ self.auto_instrument_network = auto_instrumentation.get(
83
+ "network", True
84
+ )
85
+ self.auto_instrument_custom = auto_instrumentation.get("custom", True)
86
+ else:
87
+ # If boolean provided, apply to all components
88
+ self.auto_instrument_llm = bool(auto_instrumentation)
89
+ self.auto_instrument_tool = bool(auto_instrumentation)
90
+ self.auto_instrument_agent = bool(auto_instrumentation)
91
+ self.auto_instrument_user_interaction = bool(auto_instrumentation)
92
+ self.auto_instrument_file_io = bool(auto_instrumentation)
93
+ self.auto_instrument_network = bool(auto_instrumentation)
94
+ self.auto_instrument_custom = bool(auto_instrumentation)
95
+
96
+ self.current_agent_id = contextvars.ContextVar("current_agent_id", default=None)
97
+ self.agent_children = contextvars.ContextVar("agent_children", default=[])
98
+ self.component_network_calls = {} # Store network calls per component
99
+ self.component_user_interaction = {}
100
+
101
+
102
+ def register_post_processor(self, post_processor_func):
103
+ """
104
+ Pass through the post-processor registration to the BaseTracer
105
+ """
106
+ if not callable(post_processor_func):
107
+ logger.error("post_processor_func must be a callable")
108
+ self.post_processor = post_processor_func
109
+
110
+ def __enter__(self):
111
+ """Context manager entry"""
112
+ self.start()
113
+ return self
114
+
115
+ def __exit__(self, exc_type, exc_value, traceback):
116
+ """Context manager exit"""
117
+ self.stop()
@@ -170,7 +170,7 @@ class Tracer(AgenticTracing):
170
170
  logger.error(f"Failed to retrieve projects list: {e}")
171
171
 
172
172
  # Handle agentic tracers
173
- if tracer_type == "agentic" or tracer_type.startswith("agentic/") or tracer_type == "langchain":
173
+ if tracer_type == "agentic" or tracer_type.startswith("agentic/") or tracer_type == "langchain" or tracer_type == "google-adk":
174
174
  # Setup instrumentors based on tracer type
175
175
  instrumentors = []
176
176
 
@@ -312,8 +312,11 @@ class Tracer(AgenticTracing):
312
312
 
313
313
  elif tracer_type == "agentic/openai_agents":
314
314
  from openinference.instrumentation.openai_agents import OpenAIAgentsInstrumentor
315
- instrumentors += [(OpenAIAgentsInstrumentor, [])]
315
+ instrumentors += [(OpenAIAgentsInstrumentor, [])]
316
316
 
317
+ elif tracer_type == "google-adk":
318
+ from openinference.instrumentation.google_adk import GoogleADKInstrumentor
319
+ instrumentors += [(GoogleADKInstrumentor, [])]
317
320
  else:
318
321
  # Unknown agentic tracer type
319
322
  logger.warning(f"Unknown agentic tracer type: {tracer_type}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ragaai_catalyst
3
- Version: 2.2.5b1
3
+ Version: 2.2.5b3
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>, Rishabh Pandey <rishabh.pandey@raga.ai>, Jyotsana C G <jyotsana@raga.ai>
6
6
  Requires-Python: <=3.13.2,>=3.10
@@ -41,6 +41,7 @@ Requires-Dist: openinference-instrumentation-crewai
41
41
  Requires-Dist: openinference-instrumentation-haystack
42
42
  Requires-Dist: openinference-instrumentation-openai-agents
43
43
  Requires-Dist: openinference-instrumentation-smolagents
44
+ Requires-Dist: openinference-instrumentation-google-adk
44
45
  Requires-Dist: opentelemetry-sdk
45
46
  Requires-Dist: opentelemetry-exporter-otlp
46
47
  Requires-Dist: opentelemetry-proto>=1.12.0
@@ -33,6 +33,7 @@ openinference-instrumentation-crewai
33
33
  openinference-instrumentation-haystack
34
34
  openinference-instrumentation-openai-agents
35
35
  openinference-instrumentation-smolagents
36
+ openinference-instrumentation-google-adk
36
37
  opentelemetry-sdk
37
38
  opentelemetry-exporter-otlp
38
39
  opentelemetry-proto>=1.12.0
@@ -1,376 +0,0 @@
1
- import contextvars
2
- from typing import Optional, Dict
3
- import json
4
- from datetime import datetime
5
- import uuid
6
- import os
7
- import builtins
8
- from pathlib import Path
9
- import logging
10
-
11
-
12
- from ..data.data_structure import (
13
- Trace,
14
- Metadata,
15
- SystemInfo,
16
- OSInfo,
17
- EnvironmentInfo,
18
- Resources,
19
- CPUResource,
20
- MemoryResource,
21
- DiskResource,
22
- NetworkResource,
23
- ResourceInfo,
24
- MemoryInfo,
25
- DiskInfo,
26
- NetworkInfo,
27
- Component,
28
- LLMComponent,
29
- AgentComponent,
30
- ToolComponent,
31
- NetworkCall,
32
- Interaction,
33
- Error,
34
- )
35
-
36
- from ....ragaai_catalyst import RagaAICatalyst
37
-
38
-
39
- class AgenticTracing():
40
- def __init__(self, user_detail, auto_instrumentation=None, timeout=120):
41
- self.project_name = user_detail["project_name"]
42
- self.project_id = user_detail["project_id"]
43
- self.trace_user_detail = user_detail["trace_user_detail"]
44
- self.base_url = f"{RagaAICatalyst.BASE_URL}"
45
- self.timeout = timeout
46
-
47
- # Add warning flag
48
- self._warning_shown = False
49
-
50
- self.tools: Dict[str, Tool] = {}
51
- self.call_depth = contextvars.ContextVar("call_depth", default=0)
52
- self.current_component_id = contextvars.ContextVar(
53
- "current_component_id", default=None
54
- )
55
-
56
- # Handle auto_instrumentation
57
- if auto_instrumentation is None:
58
- # Default behavior: everything enabled
59
- self.is_active = True
60
- self.auto_instrument_llm = True
61
- self.auto_instrument_tool = True
62
- self.auto_instrument_agent = True
63
- self.auto_instrument_user_interaction = True
64
- self.auto_instrument_file_io = True
65
- self.auto_instrument_network = True
66
- self.auto_instrument_custom = True
67
- else:
68
- # Set global active state
69
- self.is_active = True
70
-
71
- # Set individual components
72
- if isinstance(auto_instrumentation, dict):
73
- self.auto_instrument_llm = auto_instrumentation.get("llm", True)
74
- self.auto_instrument_tool = auto_instrumentation.get("tool", True)
75
- self.auto_instrument_agent = auto_instrumentation.get("agent", True)
76
- self.auto_instrument_user_interaction = auto_instrumentation.get(
77
- "user_interaction", True
78
- )
79
- self.auto_instrument_file_io = auto_instrumentation.get(
80
- "file_io", True
81
- )
82
- self.auto_instrument_network = auto_instrumentation.get(
83
- "network", True
84
- )
85
- self.auto_instrument_custom = auto_instrumentation.get("custom", True)
86
- else:
87
- # If boolean provided, apply to all components
88
- self.auto_instrument_llm = bool(auto_instrumentation)
89
- self.auto_instrument_tool = bool(auto_instrumentation)
90
- self.auto_instrument_agent = bool(auto_instrumentation)
91
- self.auto_instrument_user_interaction = bool(auto_instrumentation)
92
- self.auto_instrument_file_io = bool(auto_instrumentation)
93
- self.auto_instrument_network = bool(auto_instrumentation)
94
- self.auto_instrument_custom = bool(auto_instrumentation)
95
-
96
- self.current_agent_id = contextvars.ContextVar("current_agent_id", default=None)
97
- self.agent_children = contextvars.ContextVar("agent_children", default=[])
98
- self.component_network_calls = {} # Store network calls per component
99
- self.component_user_interaction = {}
100
-
101
-
102
- def start_component(self, component_id: str):
103
- """Start tracking network calls for a component"""
104
- self.component_network_calls[component_id] = []
105
- self.network_tracer.network_calls = [] # Reset network calls
106
- self.current_component_id.set(component_id)
107
- self.user_interaction_tracer.component_id.set(component_id)
108
-
109
- def end_component(self, component_id: str):
110
- """End tracking network calls for a component"""
111
- self.component_network_calls[component_id] = (
112
- self.network_tracer.network_calls.copy()
113
- )
114
- self.network_tracer.network_calls = [] # Reset for next component
115
-
116
- # Store user interactions for the component
117
- for interaction in self.user_interaction_tracer.interactions:
118
- interaction_component_id = interaction.get("component_id")
119
- if interaction_component_id not in self.component_user_interaction:
120
- self.component_user_interaction[interaction_component_id] = []
121
- if interaction not in self.component_user_interaction[interaction_component_id]:
122
- self.component_user_interaction[interaction_component_id].append(interaction)
123
-
124
- # Only reset component_id if it matches the current one
125
- # This ensures we don't reset a parent's component_id when a child component ends
126
- if self.current_component_id.get() == component_id:
127
- # Get the parent agent's component_id if it exists
128
- parent_agent_id = self.current_agent_id.get()
129
- # If there's a parent agent, set the component_id back to the parent's
130
- if parent_agent_id:
131
- self.current_component_id.set(parent_agent_id)
132
- self.user_interaction_tracer.component_id.set(parent_agent_id)
133
- else:
134
- # Only reset to None if there's no parent
135
- self.current_component_id.set(None)
136
- self.user_interaction_tracer.component_id.set(None)
137
-
138
- def register_post_processor(self, post_processor_func):
139
- """
140
- Pass through the post-processor registration to the BaseTracer
141
- """
142
- super().register_post_processor(post_processor_func)
143
-
144
- def start(self):
145
- """Start tracing"""
146
- self.is_active = True
147
-
148
- # Setup user interaction tracing
149
- self.user_interaction_tracer.project_id.set(self.project_id)
150
- self.user_interaction_tracer.trace_id.set(self.trace_id)
151
- self.user_interaction_tracer.tracer = self
152
- self.user_interaction_tracer.component_id.set(self.current_component_id.get())
153
-
154
- # Start base tracer (includes system info and resource monitoring)
155
- super().start()
156
-
157
- # Activate network tracing
158
- self.network_tracer.activate_patches()
159
-
160
- # take care of the auto instrumentation
161
- if self.auto_instrument_user_interaction:
162
- ToolTracerMixin.instrument_user_interaction_calls(self)
163
- LLMTracerMixin.instrument_user_interaction_calls(self)
164
- AgentTracerMixin.instrument_user_interaction_calls(self)
165
- CustomTracerMixin.instrument_user_interaction_calls(self)
166
- builtins.print = self.user_interaction_tracer.traced_print
167
- builtins.input = self.user_interaction_tracer.traced_input
168
-
169
- if self.auto_instrument_network:
170
- ToolTracerMixin.instrument_network_calls(self)
171
- LLMTracerMixin.instrument_network_calls(self)
172
- AgentTracerMixin.instrument_network_calls(self)
173
- CustomTracerMixin.instrument_network_calls(self)
174
-
175
- if self.auto_instrument_file_io:
176
- ToolTracerMixin.instrument_file_io_calls(self)
177
- LLMTracerMixin.instrument_file_io_calls(self)
178
- AgentTracerMixin.instrument_file_io_calls(self)
179
- CustomTracerMixin.instrument_file_io_calls(self)
180
- builtins.open = self.user_interaction_tracer.traced_open
181
-
182
- if self.auto_instrument_llm:
183
- self.instrument_llm_calls()
184
-
185
- if self.auto_instrument_tool:
186
- self.instrument_tool_calls()
187
-
188
- if self.auto_instrument_agent:
189
- self.instrument_agent_calls()
190
-
191
- if self.auto_instrument_custom:
192
- self.instrument_custom_calls()
193
-
194
- def stop(self):
195
- """Stop tracing and save results"""
196
- if self.is_active:
197
- # Restore original print and input functions
198
- builtins.print = self.user_interaction_tracer.original_print
199
- builtins.input = self.user_interaction_tracer.original_input
200
- builtins.open = self.user_interaction_tracer.original_open
201
-
202
- # Calculate final metrics before stopping
203
- self._calculate_final_metrics()
204
-
205
- # Deactivate network tracing
206
- self.network_tracer.deactivate_patches()
207
-
208
- # Clear visited metrics when stopping trace
209
- self.visited_metrics.clear()
210
-
211
- # Stop base tracer (includes saving to file)
212
- super().stop()
213
-
214
- # Cleanup
215
- self.unpatch_llm_calls()
216
- self.user_interaction_tracer.interactions = [] # Clear interactions list
217
- self.is_active = False
218
-
219
- def _calculate_final_metrics(self):
220
- """Calculate total cost and tokens from all components"""
221
- total_cost = 0.0
222
- total_tokens = 0
223
-
224
- processed_components = set()
225
-
226
- def process_component(component):
227
- nonlocal total_cost, total_tokens
228
- # Convert component to dict if it's an object
229
- comp_dict = (
230
- component.__dict__ if hasattr(component, "__dict__") else component
231
- )
232
-
233
- comp_id = comp_dict.get("id") or comp_dict.get("component_id")
234
- if comp_id in processed_components:
235
- return # Skip if already processed
236
- processed_components.add(comp_id)
237
-
238
- if comp_dict.get("type") == "llm":
239
- info = comp_dict.get("info", {})
240
- if isinstance(info, dict):
241
- # Extract cost
242
- cost_info = info.get("cost", {})
243
- if isinstance(cost_info, dict):
244
- total_cost += cost_info.get("total_cost", 0)
245
-
246
- # Extract tokens
247
- token_info = info.get("tokens", {})
248
- if isinstance(token_info, dict):
249
- total_tokens += token_info.get("total_tokens", 0)
250
- else:
251
- token_info = info.get("token_usage", {})
252
- if isinstance(token_info, dict):
253
- total_tokens += token_info.get("total_tokens", 0)
254
-
255
- # Process children if they exist
256
- data = comp_dict.get("data", {})
257
- if isinstance(data, dict):
258
- children = data.get("children", [])
259
- if children:
260
- for child in children:
261
- process_component(child)
262
-
263
- # Process all root components
264
- for component in self.components:
265
- process_component(component)
266
-
267
- # Update metadata in trace
268
- if hasattr(self, "trace"):
269
- if isinstance(self.trace.metadata, dict):
270
- self.trace.metadata["total_cost"] = total_cost
271
- self.trace.metadata["total_tokens"] = total_tokens
272
- else:
273
- self.trace.metadata.total_cost = total_cost
274
- self.trace.metadata.total_tokens = total_tokens
275
-
276
- def add_component(self, component_data: dict, is_error: bool = False):
277
- """Add a component to the trace data"""
278
- # Convert dict to appropriate Component type
279
- filtered_data = {
280
- k: v
281
- for k, v in component_data.items()
282
- if k
283
- in [
284
- "id",
285
- "hash_id",
286
- "source_hash_id",
287
- "type",
288
- "name",
289
- "start_time",
290
- "end_time",
291
- "parent_id",
292
- "info",
293
- "extra_info",
294
- "data",
295
- "metadata",
296
- "metrics",
297
- "feedback",
298
- "network_calls",
299
- "interactions",
300
- "error",
301
- ]
302
- }
303
-
304
- if component_data == None or component_data == {} or component_data.get("type", None) == None:
305
- # Only show warning if it hasn't been shown before
306
- if not self._warning_shown:
307
- import toml
308
- import os
309
- from pathlib import Path
310
-
311
- # Load supported LLM calls from TOML file
312
- current_dir = Path(__file__).parent
313
- toml_path = current_dir / "../utils/supported_llm_provider.toml"
314
- try:
315
- with open(toml_path, "r") as f:
316
- config = toml.load(f)
317
- supported_calls = ", ".join(config["supported_llm_calls"])
318
- except Exception as e:
319
- supported_calls = "Error loading supported LLM calls"
320
-
321
- # ANSI escape codes for colors and formatting
322
- RED = "\033[91m"
323
- BOLD = "\033[1m"
324
- RESET = "\033[0m"
325
- BIG = "\033[1;2m" # Makes text slightly larger in supported terminals
326
-
327
- warning_msg = f"""{RED}{BOLD}{BIG}
328
- ╔════════════════════════ COMPONENT DATA INCOMPLETE ════════════════════════╗
329
- ║ ║
330
- ║ Please ensure these requirements: ║
331
- ║ ✗ trace_llm decorator must have a stand alone llm call ║
332
- ║ ✗ trace_tool decorator must be a stand alone tool/function call ║
333
- ║ ✗ trace_agent decorator can have multiple/nested llm/tool/agent calls ║
334
- ║ ║
335
- ║ Supported LLM calls: ║
336
- ║ {supported_calls} ║
337
- ║ ║
338
- ╚══════════════════════════════════════════════════════════════════════════╝
339
- {RESET}"""
340
- # Use logger.warning for the message
341
- logging.warning(warning_msg)
342
- self._warning_shown = True
343
- return
344
-
345
- if component_data["type"] == "llm":
346
- component = LLMComponent(**filtered_data)
347
- elif component_data["type"] == "agent":
348
- component = AgentComponent(**filtered_data)
349
- elif component_data["type"] == "tool":
350
- component = ToolComponent(**filtered_data)
351
- else:
352
- component = Component(**component_data)
353
-
354
- # Check if there's an active agent context
355
- current_agent_id = self.current_agent_id.get()
356
- if current_agent_id and component_data["type"] in ["llm", "tool", "custom"]:
357
- # Add this component as a child of the current agent
358
- current_children = self.agent_children.get()
359
- current_children.append(component_data)
360
- self.agent_children.set(current_children)
361
- else:
362
- # Add component to the main trace
363
- super().add_component(component)
364
-
365
- # Handle error case
366
- if is_error and not self.current_agent_id.get():
367
- self.stop()
368
-
369
- def __enter__(self):
370
- """Context manager entry"""
371
- self.start()
372
- return self
373
-
374
- def __exit__(self, exc_type, exc_value, traceback):
375
- """Context manager exit"""
376
- self.stop()