Skip to content

Commit

Permalink
Merge branch 'main' into anthropic-ops
Browse files Browse the repository at this point in the history
  • Loading branch information
the-praxs committed Aug 14, 2024
2 parents fcad138 + 2136034 commit 1198383
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 24 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/test-notebooks.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Test Notebooks
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch: # Allows manual triggering
jobs:
test-notebooks:
runs-on: ubuntu-latest
Expand Down
8 changes: 2 additions & 6 deletions agentops/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ def main():
if args.branch_name:
fetch_time_travel_id(args.branch_name)
if args.on:
set_time_travel_active_state("on")
set_time_travel_active_state(True)
if args.off:
set_time_travel_active_state("off")


if __name__ == "__main__":
main()
set_time_travel_active_state(False)
2 changes: 1 addition & 1 deletion agentops/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def _flush_queue(self) -> None:
if not self.is_running:
return
with self.lock:
queue_copy = copy.deepcopy(self.queue) # Copy the current items
queue_copy = self.queue[:] # Copy the current items
self.queue = []

if len(queue_copy) > 0:
Expand Down
10 changes: 3 additions & 7 deletions agentops/time_travel.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import json
import yaml
import os
from .http_client import HttpClient
from .exceptions import ApiServerException
import os
from .helpers import singleton
from os import environ


@singleton
Expand Down Expand Up @@ -32,13 +31,10 @@ def __init__(self):

def fetch_time_travel_id(ttd_id):
try:
endpoint = environ.get("AGENTOPS_API_ENDPOINT", "https://api.agentops.ai")
payload = json.dumps({"ttd_id": ttd_id}).encode("utf-8")
endpoint = os.environ.get("AGENTOPS_API_ENDPOINT", "https://api.agentops.ai")
ttd_res = HttpClient.get(f"{endpoint}/v2/ttd/{ttd_id}")
if ttd_res.code != 200:
raise Exception(
f"Failed to fetch TTD with status code {ttd_res.status_code}"
)
raise Exception(f"Failed to fetch TTD with status code {ttd_res.code}")

prompt_to_returns_map = {
"completion_overrides": {
Expand Down
2 changes: 1 addition & 1 deletion docs/v0/logger.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: 'This document explains the use of the AgentOpsLogger

## AgentOps logger

The AgentsOps logger is quick and simple way of integrating your existing
The AgentOps logger is quick and simple way of integrating your existing
agent codebase with AgentOps. It allows you to use your current logs as events
by extending the built-in Python logging system to emit events to AgentOps.

Expand Down
2 changes: 1 addition & 1 deletion docs/v0/recording-events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ From this point, simply call the .record() method in the AgentOps client:
ao_client.record(Event("event_type1"))
```

In AgentsOps, each session is associated with a number of "Events". Events have
In AgentOps, each session is associated with a number of "Events". Events have
must have an "event_type" which is any abitrary string of your choice. It might be something
like "OpenAI Call". Events can also have other information such as the parameters of the operation,
the returned data, alongside tags, etc.
Expand Down
9 changes: 5 additions & 4 deletions examples/openai-gpt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,11 @@
},
"outputs": [],
"source": [
"message = ({\"role\": \"user\", \"content\": \"Write a 12 word poem about secret agents.\"},)\n",
"message = [{\"role\": \"user\", \"content\": \"Write a 12 word poem about secret agents.\"}]\n",
"res = openai.chat.completions.create(\n",
" model=\"gpt-3.5-turbo\", messages=message, temperature=0.5, stream=True\n",
")"
" model=\"gpt-3.5-turbo\", messages=message, temperature=0.5, stream=False\n",
")\n",
"print(res.choices[0].message[\"content\"])"
]
},
{
Expand Down Expand Up @@ -282,7 +283,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ Issues = "https://github.com/AgentOps-AI/agentops/issues"

[tool.autopep8]
max_line_length = 120

[project.scripts]
agentops = "agentops.cli:main"

0 comments on commit 1198383

Please sign in to comment.