

AgentOps ช่วยให้นักพัฒนาสร้างประเมินและตรวจสอบตัวแทน AI จากต้นแบบไปจนถึงการผลิต
| เล่นซ้ำการวิเคราะห์และการดีบัก | กราฟการดำเนินการเอเจนต์แบบทีละขั้นตอน |
| - การจัดการต้นทุน LLM | ติดตามการใช้จ่ายกับผู้ให้บริการโมเดล LLM Foundation |
| - การเปรียบเทียบตัวแทน | ทดสอบตัวแทนของคุณกับ 1,000+ evals |
| - การปฏิบัติตามกฎระเบียบและความปลอดภัย | ตรวจจับการฉีดยาที่รวดเร็วและการแสวงหาผลประโยชน์จากข้อมูล |
| - การรวมกรอบการทำงาน | การบูรณาการดั้งเดิมกับ Crewai, Autogen และ Langchain |
pip install agentopsเริ่มต้นไคลเอนต์ AgentOps และรับการวิเคราะห์โดยอัตโนมัติสำหรับการโทร LLM ทั้งหมดของคุณ
รับคีย์ API
import agentops
# Beginning of your program (i.e. main.py, __init__.py)
agentops . init ( < INSERT YOUR API KEY HERE > )
...
# End of program
agentops . end_session ( 'Success' ) เซสชันทั้งหมดของคุณสามารถดูได้บนแดชบอร์ด Agentops






เพิ่มความสามารถในการสังเกตที่ทรงพลังให้กับตัวแทนเครื่องมือและฟังก์ชั่นที่มีรหัสน้อยที่สุดเท่าที่จะทำได้: ทีละบรรทัด
อ้างถึงเอกสารของเรา
# Automatically associate all Events with the agent that originated them
from agentops import track_agent
@ track_agent ( name = 'SomeCustomName' )
class MyAgent :
... # Automatically create ToolEvents for tools that agents will use
from agentops import record_tool
@ record_tool ( 'SampleToolName' )
def sample_tool (...):
... # Automatically create ActionEvents for other functions.
from agentops import record_action
@ agentops . record_action ( 'sample function being record' )
def sample_function (...):
... # Manually record any other Events
from agentops import record , ActionEvent
record ( ActionEvent ( "received_user_input" )) สร้างตัวแทนลูกเรือที่มีความสามารถสังเกตได้ด้วยรหัสเพียง 2 บรรทัด เพียงตั้งค่า AGENTOPS_API_KEY ในสภาพแวดล้อมของคุณและทีมงานของคุณจะได้รับการตรวจสอบอัตโนมัติบนแดชบอร์ด AgentOps
pip install ' crewai[agentops] ' ด้วยรหัสเพียงสองบรรทัดเพิ่มความสามารถในการสังเกตอย่างเต็มที่และตรวจสอบตัวแทน Autogen ตั้งค่า AGENTOPS_API_KEY ในสภาพแวดล้อมของคุณและเรียก agentops.init()
Agentops ทำงานได้อย่างราบรื่นกับแอปพลิเคชันที่สร้างขึ้นโดยใช้ Langchain หากต้องการใช้ตัวจัดการให้ติดตั้ง Langchain เป็นตัวเลือกการพึ่งพา:
pip install agentops[langchain]เพื่อใช้ตัวจัดการนำเข้าและตั้งค่า
import os
from langchain . chat_models import ChatOpenAI
from langchain . agents import initialize_agent , AgentType
from agentops . partners . langchain_callback_handler import LangchainCallbackHandler
AGENTOPS_API_KEY = os . environ [ 'AGENTOPS_API_KEY' ]
handler = LangchainCallbackHandler ( api_key = AGENTOPS_API_KEY , tags = [ 'Langchain Example' ])
llm = ChatOpenAI ( openai_api_key = OPENAI_API_KEY ,
callbacks = [ handler ],
model = 'gpt-3.5-turbo' )
agent = initialize_agent ( tools ,
llm ,
agent = AgentType . CHAT_ZERO_SHOT_REACT_DESCRIPTION ,
verbose = True ,
callbacks = [ handler ], # You must pass in a callback handler to record your agent
handle_parsing_errors = True )ตรวจสอบสมุดบันทึกตัวอย่าง Langchain สำหรับรายละเอียดเพิ่มเติมรวมถึง Async Handlers
การสนับสนุนชั้นหนึ่งสำหรับ Cohere (> = 5.4.0) นี่คือการรวมชีวิตหากคุณต้องการฟังก์ชั่นเพิ่มเติมใด ๆ โปรดส่งข้อความถึงเราใน Discord!
pip install cohere import cohere
import agentops
# Beginning of program's code (i.e. main.py, __init__.py)
agentops . init ( < INSERT YOUR API KEY HERE > )
co = cohere . Client ()
chat = co . chat (
message = "Is it pronounced ceaux-hear or co-hehray?"
)
print ( chat )
agentops . end_session ( 'Success' ) import cohere
import agentops
# Beginning of program's code (i.e. main.py, __init__.py)
agentops . init ( < INSERT YOUR API KEY HERE > )
co = cohere . Client ()
stream = co . chat_stream (
message = "Write me a haiku about the synergies between Cohere and AgentOps"
)
for event in stream :
if event . event_type == "text-generation" :
print ( event . text , end = '' )
agentops . end_session ( 'Success' )ตัวแทนติดตามที่สร้างขึ้นด้วยมานุษยวิทยา Python SDK (> = 0.32.0)
pip install anthropic import anthropic
import agentops
# Beginning of program's code (i.e. main.py, __init__.py)
agentops . init ( < INSERT YOUR API KEY HERE > )
client = anthropic . Anthropic (
# This is the default and can be omitted
api_key = os . environ . get ( "ANTHROPIC_API_KEY" ),
)
message = client . messages . create (
max_tokens = 1024 ,
messages = [
{
"role" : "user" ,
"content" : "Tell me a cool fact about AgentOps" ,
}
],
model = "claude-3-opus-20240229" ,
)
print ( message . content )
agentops . end_session ( 'Success' )การสตรีม
import anthropic
import agentops
# Beginning of program's code (i.e. main.py, __init__.py)
agentops . init ( < INSERT YOUR API KEY HERE > )
client = anthropic . Anthropic (
# This is the default and can be omitted
api_key = os . environ . get ( "ANTHROPIC_API_KEY" ),
)
stream = client . messages . create (
max_tokens = 1024 ,
model = "claude-3-opus-20240229" ,
messages = [
{
"role" : "user" ,
"content" : "Tell me something cool about streaming agents" ,
}
],
stream = True ,
)
response = ""
for event in stream :
if event . type == "content_block_delta" :
response += event . delta . text
elif event . type == "message_stop" :
print ( " n " )
print ( response )
print ( " n " )async
import asyncio
from anthropic import AsyncAnthropic
client = AsyncAnthropic (
# This is the default and can be omitted
api_key = os . environ . get ( "ANTHROPIC_API_KEY" ),
)
async def main () -> None :
message = await client . messages . create (
max_tokens = 1024 ,
messages = [
{
"role" : "user" ,
"content" : "Tell me something interesting about async agents" ,
}
],
model = "claude-3-opus-20240229" ,
)
print ( message . content )
await main ()ตัวแทนติดตามที่สร้างขึ้นด้วยมานุษยวิทยา Python SDK (> = 0.32.0)
pip install mistralaiการซิงค์
from mistralai import Mistral
import agentops
# Beginning of program's code (i.e. main.py, __init__.py)
agentops . init ( < INSERT YOUR API KEY HERE > )
client = Mistral (
# This is the default and can be omitted
api_key = os . environ . get ( "MISTRAL_API_KEY" ),
)
message = client . chat . complete (
messages = [
{
"role" : "user" ,
"content" : "Tell me a cool fact about AgentOps" ,
}
],
model = "open-mistral-nemo" ,
)
print ( message . choices [ 0 ]. message . content )
agentops . end_session ( 'Success' )การสตรีม
from mistralai import Mistral
import agentops
# Beginning of program's code (i.e. main.py, __init__.py)
agentops . init ( < INSERT YOUR API KEY HERE > )
client = Mistral (
# This is the default and can be omitted
api_key = os . environ . get ( "MISTRAL_API_KEY" ),
)
message = client . chat . stream (
messages = [
{
"role" : "user" ,
"content" : "Tell me something cool about streaming agents" ,
}
],
model = "open-mistral-nemo" ,
)
response = ""
for event in message :
if event . data . choices [ 0 ]. finish_reason == "stop" :
print ( " n " )
print ( response )
print ( " n " )
else :
response += event . text
agentops . end_session ( 'Success' )async
import asyncio
from mistralai import Mistral
client = Mistral (
# This is the default and can be omitted
api_key = os . environ . get ( "MISTRAL_API_KEY" ),
)
async def main () -> None :
message = await client . chat . complete_async (
messages = [
{
"role" : "user" ,
"content" : "Tell me something interesting about async agents" ,
}
],
model = "open-mistral-nemo" ,
)
print ( message . choices [ 0 ]. message . content )
await main ()สตรีมมิ่ง
import asyncio
from mistralai import Mistral
client = Mistral (
# This is the default and can be omitted
api_key = os . environ . get ( "MISTRAL_API_KEY" ),
)
async def main () -> None :
message = await client . chat . stream_async (
messages = [
{
"role" : "user" ,
"content" : "Tell me something interesting about async streaming agents" ,
}
],
model = "open-mistral-nemo" ,
)
response = ""
async for event in message :
if event . data . choices [ 0 ]. finish_reason == "stop" :
print ( " n " )
print ( response )
print ( " n " )
else :
response += event . text
await main ()AgentOps ให้การสนับสนุนสำหรับ Litellm (> = 1.3.1) ช่วยให้คุณสามารถโทร 100+ LLM โดยใช้รูปแบบอินพุต/เอาต์พุตเดียวกัน
pip install litellm # Do not use LiteLLM like this
# from litellm import completion
# ...
# response = completion(model="claude-3", messages=messages)
# Use LiteLLM like this
import litellm
...
response = litellm . completion ( model = "claude-3" , messages = messages )
# or
response = await litellm . acompletion ( model = "claude-3" , messages = messages )AgentOps ทำงานได้อย่างราบรื่นกับแอปพลิเคชันที่สร้างขึ้นโดยใช้ Llamaidex ซึ่งเป็นกรอบสำหรับการสร้างแอปพลิเคชัน AI ที่มีบริบทที่เพิ่มขึ้นด้วย LLMS
pip install llama-index-instrumentation-agentopsเพื่อใช้ตัวจัดการนำเข้าและตั้งค่า
from llama_index . core import set_global_handler
# NOTE: Feel free to set your AgentOps environment variables (e.g., 'AGENTOPS_API_KEY')
# as outlined in the AgentOps documentation, or pass the equivalent keyword arguments
# anticipated by AgentOps' AOClient as **eval_params in set_global_handler.
set_global_handler ( "agentops" )ตรวจสอบเอกสาร Llamaidex สำหรับรายละเอียดเพิ่มเติม

ลองดู!
(เร็วๆ นี้!)
| แพลตฟอร์ม | แผงหน้าปัด | Evals |
|---|---|---|
| ✅ Python SDK | ✅ตัวชี้วัดหลายเซสชันและข้ามเซสชั่น | ✅ตัวชี้วัดการประเมินแบบกำหนดเอง |
| - API ผู้สร้างการประเมินผล | ✅การติดตามแท็กเหตุการณ์ที่กำหนดเอง | ดัชนีชี้วัด |
| ✅ JavaScript/TypeScript SDK | ✅ repalays เซสชัน | สนามเด็กเล่นประเมิน + ลีดเดอร์บอร์ด |
| การทดสอบประสิทธิภาพ | สภาพแวดล้อม | การทดสอบ LLM | การทดสอบการใช้เหตุผลและการดำเนินการ |
|---|---|---|---|
| ✅การวิเคราะห์เวลาแฝงเหตุการณ์ | การทดสอบสภาพแวดล้อมที่ไม่คงที่ | การตรวจจับฟังก์ชั่นที่ไม่ได้กำหนด LLM | - ลูปที่ไม่มีที่สิ้นสุดและการตรวจจับความคิดแบบเรียกซ้ำ |
| ✅การกำหนดราคาการทำงานของตัวแทนเวิร์กโฟลว์ | สภาพแวดล้อมที่หลากหลาย | - โทเค็นขีด จำกัด ธงล้น | การตรวจจับการใช้เหตุผลที่ผิดพลาด |
| - ผู้ตรวจสอบความสำเร็จ (ภายนอก) | คอนเทนเนอร์ดำเนินการ | ขีด จำกัด บริบทของธงล้น | ตัวตรวจสอบรหัสทั่วไป |
| ตัวควบคุมตัวแทน/การทดสอบทักษะ | ✅ honeypot และการตรวจจับการฉีดทันที (Promptarmor) | การติดตามใบเรียกเก็บเงิน API | การวิเคราะห์เบรกพอยต์ข้อผิดพลาด |
| การทดสอบข้อ จำกัด บริบทของข้อมูล | anti-agent roadblocks (เช่น captchas) | การตรวจสอบการรวม CI/CD | |
| การทดสอบการถดถอย | การสร้างภาพเฟรมเวิร์กหลายตัวแทน |
หากไม่มีเครื่องมือที่เหมาะสมตัวแทน AI นั้นช้าราคาแพงและไม่น่าเชื่อถือ ภารกิจของเราคือการนำตัวแทนของคุณจากต้นแบบไปสู่การผลิต นี่คือเหตุผลที่ AgentOps โดดเด่น:
AgentOps ได้รับการออกแบบมาเพื่อให้การสังเกตการทดสอบและการตรวจสอบเป็นตัวแทนง่าย
ตรวจสอบการเติบโตของเราในชุมชน:
| ที่เก็บ | ดารา |
|---|---|
| geekan / metagpt | 42787 |
| run-llama / llama_index | 34446 |
| Crewaiinc / Crewai | 2370 |
| อูฐ-เอ / อูฐ | 5166 |
| superagent-ai / superagent | 5050 |
| Iyaja / llama-fs | 4713 |
| จากฮาร์ดแวร์ / omi | 2723 |
| Mervinpraison / Praisonai | 2550 |
| agentops-ai / jaiqu | 272 |
| strnad / crewai-studio | 134 |
| Alejandro-ao / exa-crewai | 55 |
| tonykipkemboi / youtube_yapper_trapper | 47 |
| Sethcoast / Cover-Letter-Builder | 27 |
| Bhancockio / chatgpt4o-analysis | 19 |
| breakstring / agentic_story_book_workflow | 14 |
| Multi-on / Multion-Python | 13 |
สร้างขึ้นโดยใช้ GitHub-dependents-info โดย Nicolas Vuillamy