Skip to main content

LangSmith API Wrappers

Some functionality to wrap common apis (e.g., openai) with LangSmith instrumentation.

Example:

from langsmith.wrappers.openai import openai

result = openai.ChatCompletion.create(
    model="gpt-3.5-turbo",
    messages=[
        {
            "role": "user",
            "content": "What's the weather like in san francisco right now?",
        }
    ],
    functions=[
        {
            "name": "get_current_weather",
            "description": "Get the current weather in a given location",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {
                        "type": "string",
                        "description": "The city and state, e.g. San Francisco, CA",
                    },
                    "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
                },
                "required": ["location"],
            },
        }
    ],
)
print(result)

You can try wrapping your own library. Function calls will be mapped as "chain" runs.

Example:

from langsmith.wrappers.base import ModuleWrapper
import transformers as transformers_base
transformers = ModuleWrapper(transformers_base)

pipe = transformers.pipeline("text2text-generation", model="google/t5-efficient-tiny")
result = pipe("This is a test")

Metadata

Release files for langsmith-wrappers 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langsmith-wrappers 0.0.1
File Size Uploaded Provenance Actions
langsmith_wrappers-0.0.1.tar.gz 3.4 kB Without provenance Details for langsmith_wrappers-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langsmith-wrappers 0.0.1
File Interpreter ABI Platform Actions
langsmith_wrappers-0.0.1-py3-none-any.whl Python 3 none any Details for langsmith_wrappers-0.0.1-py3-none-any.whl

Total release size: 8.0 kB

Release files / langsmith_wrappers-0.0.1.tar.gz

Download URL langsmith_wrappers-0.0.1.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
897b051bddec05f1ba937f3b7427bf844ac305e53e95430ace768f9fe0ec1a54
BLAKE2b-256 checksum
How to use checksums
fe8389dcb89ab83d6a6cc7e97278e52ba863256aa6306c243bfa490c55a956c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.11.2 Darwin/22.5.0

Release files / langsmith_wrappers-0.0.1-py3-none-any.whl

Download URL langsmith_wrappers-0.0.1-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
557671f126263fd8511b2a452ba07403873ad708e4f93db77c6daa7ce54d2452
BLAKE2b-256 checksum
How to use checksums
274a7c2ec1df68333e698b1ce3ca1e32af5af652c5c8041219bec65f259c754a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.11.2 Darwin/22.5.0

Security for langsmith-wrappers 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page