- Notifications
You must be signed in to change notification settings - Fork128
LangSmith Client SDK Implementations
License
langchain-ai/langsmith-sdk
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This repository contains the Python and Javascript SDK's for interacting with theLangSmith platform. Please seeLangSmith Documentationfor documentation about using the LangSmith platform and the client SDK.
LangSmith helps your team debug, evaluate, and monitor your language models and intelligent agents. It workswith any LLM Application, including a native integration with theLangChain Python andLangChain JS open source libraries.
LangSmith is developed and maintained byLangChain, the company behind the LangChain framework.
To get started with the Python SDK,install the package, then follow the instructions in thePython README.
pip install -U langsmithexport LANGSMITH_TRACING=trueexport LANGSMITH_API_KEY=ls_...
Then start tracing your app:
importopenaifromlangsmithimporttraceablefromlangsmith.wrappersimportwrap_openaiclient=wrap_openai(openai.Client())client.chat.completions.create(messages=[{"role":"user","content":"Hello, world"}],model="gpt-3.5-turbo")
To get started with the JavaScript / TypeScript SDK,install the package, then follow the instructions in theJS README.
yarn add langsmithexport LANGSMITH_TRACING=trueexport LANGSMITH_API_KEY=ls_...
Then start tracing your app!
import{OpenAI}from"openai";import{traceable}from"langsmith/traceable";import{wrapOpenAI}from"langsmith/wrappers";constclient=wrapOpenAI(newOpenAI());awaitclient.chat.completions.create({model:"gpt-3.5-turbo",messages:[{content:"Hi there!",role:"user"}],});
{ id: 'chatcmpl-8sOWEOYVyehDlyPcBiaDtTxWvr9v6', object: 'chat.completion', created: 1707974654, model: 'gpt-3.5-turbo-0613', choices: [ { index: 0, message: { role: 'assistant', content: 'Hello! How can I help you today?' }, logprobs: null, finish_reason: 'stop' } ], usage: { prompt_tokens: 10, completion_tokens: 9, total_tokens: 19 }, system_fingerprint: null}
For tutorials on how to get more value out of LangSmith, check out theLangsmith Cookbook repo.
To learn more about the LangSmith platform, check out thedocs
About
LangSmith Client SDK Implementations
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.