Skip to main content

A log tracking client integration code for OpenAI agents sdk

Project description

A log tracking client integration code for OpenAI agents sdk

Quick Start

  1. 安装client lib sdk
pip install tracker2k
  1. 集成agent服务代码
import tracker2k

# 注:
#   1.app_name:指服务的应用名字,例如:chuxing-assistant, travel-assistant
#   2.env_name:指服务应用的环境名称,例如:dev, pre, prod
#   3.endpoint:指链路远端服务地址
#       - 测试环境:https://ainlp-offline.xiaojukeji.com/asst/logagent/xuanji
#       - 线上环境:http://10.88.151.15:22323/logagent/xuanji
tracker2k.init(app_name="chuxing-assistant", env_name="dev", endpoint="https://ainlp-offline.xiaojukeji.com/asst/logagent/xuanji")


# 注:
#   1 trace_id 对应链路的trace_id
#   2. metadata中的query和uid,对应用户请求query和用户id

with trace(
        workflow_name=f"LPY Agent ({session_id})",
        group_id=f'Lpy Agent',
        trace_id=trace_id,
        metadata={"query": user_input, "uid": uid}
    ):
    ...your code...
  1. 查看追踪数据

界面地址(测试环境):https://yunzhi-dev.intra.xiaojukeji.com/#/traceOverview

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tracker2k-0.0.3.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tracker2k-0.0.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file tracker2k-0.0.3.tar.gz.

File metadata

  • Download URL: tracker2k-0.0.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.19

File hashes

Hashes for tracker2k-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d97dacdbe1d34484fdbccb58b02bde63efd2d011632e0a739e99d7da671f8dfa
MD5 a8c549fb553f227d29421c8e88683282
BLAKE2b-256 9c2f228b296cbdfb1f0221fc62af0d03646596881b0d64ec69d896f8122de7e0

See more details on using hashes here.

File details

Details for the file tracker2k-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: tracker2k-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.19

File hashes

Hashes for tracker2k-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 64b10a68a596b8c6ad9a53c7c642ba80bf8facb6099dd4f30c2f5ab0e42637ac
MD5 769a3bbdd7d16523ff623e5111e3f838
BLAKE2b-256 3d8003c4f3ef553587967f76a1debc3142e3a7d9ee1432d48b8bd114bd27f321

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page