-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
501 additions
and
105 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# External Images Directory | ||
|
||
## Purpose | ||
This directory serves as a centralized repository for images that are used not only within our documentation but also embedded in external websites via direct links. | ||
|
||
## Automatic Synchronization | ||
Any updates made to the images in this directory (such as replacing an image file with a new version) will be reflected across all external sites that display these images. This is because the image URLs remain constant, and the external sites dynamically fetch the latest version of the image from this directory. | ||
|
||
To create a URL that consistenly updates, use the pattern: | ||
``` | ||
https://raw.githubusercontent.com/AgentOps-AI/agentops/main/docs/images/external/<filename>.<extension> | ||
``` | ||
|
||
## Usage Guidelines | ||
- **Updating Images**: To update an image, upload the new file with the exact same name as the one it's replacing. This ensures that the image update is seamless across all platforms. | ||
- **Consistency**: Regularly check that the images are up-to-date and accurately represent our brand and documentation standards. | ||
- **Do Not Remove**: Avoid deleting images from this directory. Removal of images can lead to broken links and missing visuals on external sites that rely on these images. | ||
|
||
## Example | ||
If you update the `logo.png` file in this directory, the new logo will automatically appear in place of the old one on all external documentation pages that link to this image. | ||
|
||
**Important**: Deletions and modifications can have immediate and widespread effects. Always verify that changes made here are intentional and correct before proceeding. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"<h1>MultiOn Tracking Web Browse Actions</h1>\n", | ||
"<img src=\"https://github.com/AgentOps-AI/agentops/blob/b4aac2d4b9fb16d6aa0a25aa9018210a94f1bef2/docs/logo/multion_integration.png?raw=true\" width=\"250px\" style=\"max-width: 100%; height: auto;\"/>\n", | ||
" \n", | ||
"Agents using MultiOn can launch and control remote or local web browsers to perform actions and retrieve context using natural language commands. With AgentOps, MultiOn evens such as browse, retrieve, and step are automatically tracked.\n", | ||
"\n", | ||
"\n", | ||
"![AgentOps MultiOn Browse](https://github.com/AgentOps-AI/agentops/blob/main/docs/images/agentops-multion-browse.gif?raw=true)\n", | ||
"\n", | ||
"Furthermore, events and LLM calls in your Python program will be tracked as well." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Install dependencies\n", | ||
"%pip install multion\n", | ||
"%pip install agentops\n", | ||
"%pip install openai" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import os\n", | ||
"from multion.client import MultiOn\n", | ||
"from multion.core.request_options import RequestOptions\n", | ||
"import openai\n", | ||
"import agentops" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Set your API keys\n", | ||
"import os\n", | ||
"os.environ[\"MULTION_API_KEY\"] = \"multion_key\"\n", | ||
"os.environ[\"AGENTOPS_API_KEY\"] = \"agentops_key\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Create an AgentOps session\n", | ||
"When running `agentops.init()`, be sure to set `auto_start_session=False`. MultiOn will automatically launch AgentOps sessions by default, but by setting auto start to false, you can configure your AgentOps client independently." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"agentops.init(auto_start_session=False, tags=['MultiOn browse example'])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Now, we can launch a MultiOn browse event. This event will automatically get added to your AgentOps session." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"multion = MultiOn(\n", | ||
" api_key=os.environ.get(\"MULTION_API_KEY\"),\n", | ||
" agentops_api_key=os.environ.get(\"AGENTOPS_API_KEY\"),\n", | ||
")\n", | ||
"cmd = \"what three things do i get with agentops\"\n", | ||
"request_options = RequestOptions(\n", | ||
" timeout_in_seconds=60, max_retries=4, additional_headers={\"test\": \"ing\"}\n", | ||
")\n", | ||
"\n", | ||
"browse_response = multion.browse(\n", | ||
" cmd=\"what three things do i get with agentops\",\n", | ||
" url=\"https://www.agentops.ai/\",\n", | ||
" max_steps=4,\n", | ||
" include_screenshot=True,\n", | ||
" request_options=request_options,\n", | ||
")\n", | ||
"\n", | ||
"print(browse_response.message)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Let's use OpenAI to summarize our output" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"messages = [{\"role\": \"user\", \"content\": f\"Format this data as a markdown table: {browse_response.message}\"}]\n", | ||
"client = openai.OpenAI()\n", | ||
"response = client.chat.completions.create(messages=messages, model=\"gpt-3.5-turbo\")\n", | ||
"\n", | ||
"print(response.choices[0].message.content)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# End session to see your dashboard\n", | ||
"agentops.end_session('Success')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Check your session\n", | ||
"Check your session on [AgentOps](https://app.agentops.ai). This session should include the MultiOn browse action and the OpenAI call." | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.5" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.