-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AgentOps Implementation #2516
AgentOps Implementation #2516
Conversation
@microsoft-github-policy-service agree company="AgentOps" |
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
10404662 | Triggered | Generic CLI Secret | 0d685f3 | .github/workflows/dotnet-release.yml | View secret |
10404662 | Triggered | Generic CLI Secret | 74dbc5e | .github/workflows/dotnet-release.yml | View secret |
- | Generic High Entropy Secret | db9fb81 | website/docs/tutorial/tool-use.ipynb | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Two things to help this moving forward:
- Can you take a look at the databricks PR for comments regarding ecosystem page (i.e., having a logo helps) and how to make the notebook displayed on the website. DBRX (Databricks LLM) example notebook #2434
- Can you take a look at
autogen.runtime_logging
for our logging entry points?
# Conflicts: # pyproject.toml # setup.py
|
Could you fix code formatting error? https://github.com/microsoft/autogen/actions/runs/8885436373/job/24396787206?pr=2516 |
@cheng-tan can you take a look at the action events this PR added in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please write tests to cover the newly added code? The tests can be run in a subset of envs of the CI.
__all__ = ("ConversableAgent",) | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
F = TypeVar("F", bound=Callable[..., Any]) | ||
|
||
|
||
@track_agent() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this decorator do if activated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wraps the init function of the class to assign an agentops ID. Then in our instrumentation of LLM calls, we look up the call stack to see if the call or Event
is being made by a decorated agent class. If so, we relate them in our db
original_init = obj.__init__
def new_init(self, *args, **kwargs):
try:
original_init(self, *args, **kwargs)
self.agent_ops_agent_id = str(uuid4())
Client().create_agent(self.agent_ops_agent_id, self.agent_ops_agent_name)
except AttributeError as e:
logger.warning("AgentOps failed to track an agent. This often happens if agentops.init() was not "
"called before initializing an agent with the @track_agent decorator.")
raise e
obj.__init__ = new_init
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the biggest thing preventing us from using the runtime_logging
as events like log_chat_completion
don't have an Agent ID that we can use to display what agents performed what functions. I can make a note of this in the related issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a unique agent ID is certainly useful for many other things. We can add an id field in the agent constructor to generate an id upon creation or using an existing id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sonichi @jackgerrits for adding a new id field for each agent to support external analytics
@@ -637,16 +652,29 @@ def send( | |||
Raises: | |||
ValueError: if the message can't be converted into a valid ChatCompletion message. | |||
""" | |||
action_event = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you take a look at runtime_logging module and work with @lalo in #2423 to add new events through the logging API rather than adding agent ops specific code here?
Can you also implement an agent ops logger to cover those new events. You can take a look at the ongoing PR by our colleague at Microsoft's cosmos db as a reference. #2329
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal is to have a custom logger that user can pass into runtime_logging, and the custom logger (I.e, agent ops logger) can receive all events logged by the runtime_logging.
Head branch was pushed to by a user without write access
Why are these changes needed?
This PR integrates AgentOps agent observability within Autogen. Autogen users can start tracking a plethora of data by simply adding
agentops.init()
to their code.AgentOps is added as an optional dependency and can be installed with
pip install pyautogen[agentops]
.https://www.loom.com/share/8b489e9c07aa4211a87d0f8092e317d9?sid=b09e7576-c507-4a8d-aae3-6394716d40d2
Related issue number
Checks