portkey-python-sdk
portkey-python-sdk copied to clipboard
Build reliable, secure, and production-ready AI apps easily.
Adding support for `x-portkey-input-audio-length` header for calculating cost of input audio **Related Issues:** https://github.com/Portkey-AI/portkey-python-sdk/issues/220
### Contact Details _No response_ ### What happened? This header is to be used for calculation cost of requests to /audio/transcriptions and /audio/translations ### Version 0.1.xx (Default) ### Relevant log...
This PR introduces changes for a simplified framework for instrumenting traces to portkey from the sdk. The main changes in this PR are: - introduce decorator `@watch` for tracing custom...
## Problem When users pass `extra_body={'a': 'b'}` to API methods like `client.chat.completions.create()`, the contents should be merged at the **top level** of the request body. Instead, the SDK was nesting...
## Problem When using Portkey with libraries like pydantic-ai that pass `NOT_GIVEN` values from the standard openai package, users encounter: ``` TypeError: Object of type NotGiven is not JSON serializable...
**Title:** **Description:** - Detailed change 1 - Detailed change 2 - ... **Motivation:** **Related Issues:** #
**Title:** Default base_url for HTTP Client **Description:** - Adds default base_url to passed http client if not passed by the user **Motivation:** Sid asked for it **Related Issues:** Fixes: #402
**Title:** Vendoring openai 2.7.1 **Description:** - input token count introduced **Motivation:** **Related Issues:** Closes: #408
The "Compatibility with OpenAI SDK" section displayed outdated version numbers (OpenAI v1.26.0, Portkey v1.3.1). ## Changes - Updated compatibility table headers to reflect current versions: OpenAI v2.2.0 and Portkey v2.0.2...