Skip to content

Initiate support for agent and tracing frameworks#66

Merged
ultmaster merged 10 commits intomainfrom
weave-support
Aug 1, 2025
Merged

Initiate support for agent and tracing frameworks#66
ultmaster merged 10 commits intomainfrom
weave-support

Conversation

@ultmaster
Copy link
Contributor

First batch:

  • Langchain
  • Weave
  • AgentOps
  • MLFlow

Copilot AI review requested due to automatic review settings July 30, 2025 09:57

This comment was marked as outdated.

@ultmaster ultmaster requested a review from Copilot August 1, 2025 05:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces integration support for agent and tracing frameworks including Langchain, Weave, AgentOps, and MLFlow. The changes expand the POML library's tracing capabilities from local-only to supporting multiple external tracing backends.

  • Enhanced set_trace() to support multiple backends ("local", "weave", "agentops", "mlflow")
  • Added framework-specific integration modules for logging POML calls
  • Introduced new output formats including OpenAI chat and Langchain message formats

Reviewed Changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
python/poml/api.py Core API changes for multi-backend tracing support and new output formats
python/poml/integration/weave.py Weave integration for logging POML calls
python/poml/integration/mlflow.py MLflow integration with prompt registration
python/poml/integration/langchain.py Langchain template integration with POML
python/poml/integration/agentops.py AgentOps integration for operation tracking
python/tests/manual/*.py Manual test examples for each integration
python/tests/manual/example_poml.poml POML template file for testing
pyproject.toml Added pydantic dependency
python/.gitignore Added common integration artifacts to ignore
Comments suppressed due to low confidence (1)

python/tests/manual/example_mlflow_poml.py:29

  • The model 'gpt-4.1-mini' does not exist. This should likely be 'gpt-4o-mini' to match the model used in the previous call on line 24.
    model="gpt-4.1-mini",

Comment on lines +72 to +73
if enabled or "local" in enabled:
# When enabled is non-empty, we always enable local tracing.
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition will always be True when enabled is a non-empty list, even if 'local' is not in the list. This should be 'if enabled and (isinstance(enabled, list) and "local" in enabled or enabled == ["local"])' or similar logic to properly check for local tracing.

Suggested change
if enabled or "local" in enabled:
# When enabled is non-empty, we always enable local tracing.
if enabled and (isinstance(enabled, list) and "local" in enabled or enabled == ["local"]):
# Enable local tracing only when explicitly requested.

Copilot uses AI. Check for mistakes.
Comment on lines +93 to +103
if "weave" in enabled:
_weave_enabled = True
else:
_trace_dir = None
_weave_enabled = False

if "agentops" in enabled:
_agentops_enabled = True
else:
_agentops_enabled = False

if "mlflow" in enabled:
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will raise a TypeError if enabled is True or False (bool values don't support 'in' operator). Add a type check: 'if isinstance(enabled, list) and "weave" in enabled:'

Suggested change
if "weave" in enabled:
_weave_enabled = True
else:
_trace_dir = None
_weave_enabled = False
if "agentops" in enabled:
_agentops_enabled = True
else:
_agentops_enabled = False
if "mlflow" in enabled:
if isinstance(enabled, list) and "weave" in enabled:
_weave_enabled = True
else:
_weave_enabled = False
if isinstance(enabled, list) and "agentops" in enabled:
_agentops_enabled = True
else:
_agentops_enabled = False
if isinstance(enabled, list) and "mlflow" in enabled:

Copilot uses AI. Check for mistakes.
Comment on lines +93 to +103
if "weave" in enabled:
_weave_enabled = True
else:
_trace_dir = None
_weave_enabled = False

if "agentops" in enabled:
_agentops_enabled = True
else:
_agentops_enabled = False

if "mlflow" in enabled:
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will raise a TypeError if enabled is True or False (bool values don't support 'in' operator). Add a type check: 'if isinstance(enabled, list) and "agentops" in enabled:'

Suggested change
if "weave" in enabled:
_weave_enabled = True
else:
_trace_dir = None
_weave_enabled = False
if "agentops" in enabled:
_agentops_enabled = True
else:
_agentops_enabled = False
if "mlflow" in enabled:
if isinstance(enabled, list) and "weave" in enabled:
_weave_enabled = True
else:
_weave_enabled = False
if isinstance(enabled, list) and "agentops" in enabled:
_agentops_enabled = True
else:
_agentops_enabled = False
if isinstance(enabled, list) and "mlflow" in enabled:

Copilot uses AI. Check for mistakes.
Comment on lines +93 to +103
if "weave" in enabled:
_weave_enabled = True
else:
_trace_dir = None
_weave_enabled = False

if "agentops" in enabled:
_agentops_enabled = True
else:
_agentops_enabled = False

if "mlflow" in enabled:
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will raise a TypeError if enabled is True or False (bool values don't support 'in' operator). Add a type check: 'if isinstance(enabled, list) and "mlflow" in enabled:'

Suggested change
if "weave" in enabled:
_weave_enabled = True
else:
_trace_dir = None
_weave_enabled = False
if "agentops" in enabled:
_agentops_enabled = True
else:
_agentops_enabled = False
if "mlflow" in enabled:
if isinstance(enabled, list) and "weave" in enabled:
_weave_enabled = True
else:
_weave_enabled = False
if isinstance(enabled, list) and "agentops" in enabled:
_agentops_enabled = True
else:
_agentops_enabled = False
if isinstance(enabled, list) and "mlflow" in enabled:

Copilot uses AI. Check for mistakes.
@ultmaster ultmaster merged commit 25e9291 into main Aug 1, 2025
3 checks passed
@ultmaster ultmaster deleted the weave-support branch August 27, 2025 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants