# LangSmith API Wrappers
Some functionality to wrap common apis (e.g., `openai`) with [LangSmith](https://smith.langchain.com/) instrumentation.
Example:
```python
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:
```python
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")
```
Raw data
{
"_id": null,
"home_page": "https://github.com/langchain-ai/langsmith-wrappers",
"name": "langsmith-wrappers",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "LangChain",
"author_email": "support@langchain.com",
"download_url": "https://files.pythonhosted.org/packages/fe/83/89dcb89ab83d6a6cc7e97278e52ba863256aa6306c243bfa490c55a956c3/langsmith_wrappers-0.0.1.tar.gz",
"platform": null,
"description": "# LangSmith API Wrappers\n\n\nSome functionality to wrap common apis (e.g., `openai`) with [LangSmith](https://smith.langchain.com/) instrumentation.\n\n\nExample:\n\n```python\nfrom langsmith.wrappers.openai import openai\n\nresult = openai.ChatCompletion.create(\n model=\"gpt-3.5-turbo\",\n messages=[\n {\n \"role\": \"user\",\n \"content\": \"What's the weather like in san francisco right now?\",\n }\n ],\n functions=[\n {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\",\n },\n \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n },\n \"required\": [\"location\"],\n },\n }\n ],\n)\nprint(result)\n```\n\n\nYou can try wrapping your own library. Function calls will be mapped as \"chain\" runs.\n\nExample:\n\n```python\nfrom langsmith.wrappers.base import ModuleWrapper\nimport transformers as transformers_base\ntransformers = ModuleWrapper(transformers_base)\n\npipe = transformers.pipeline(\"text2text-generation\", model=\"google/t5-efficient-tiny\")\nresult = pipe(\"This is a test\")\n```",
"bugtrack_url": null,
"license": "MIT",
"summary": "Experimental wrappers that also log to LangSmith.",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/langchain-ai/langsmith-wrappers",
"Repository": "https://github.com/langchain-ai/langsmith-wrappers"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "274a7c2ec1df68333e698b1ce3ca1e32af5af652c5c8041219bec65f259c754a",
"md5": "d28d86bb5a92b1d5e5125f907b7a7a6d",
"sha256": "557671f126263fd8511b2a452ba07403873ad708e4f93db77c6daa7ce54d2452"
},
"downloads": -1,
"filename": "langsmith_wrappers-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d28d86bb5a92b1d5e5125f907b7a7a6d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 4555,
"upload_time": "2023-08-25T02:28:49",
"upload_time_iso_8601": "2023-08-25T02:28:49.762082Z",
"url": "https://files.pythonhosted.org/packages/27/4a/7c2ec1df68333e698b1ce3ca1e32af5af652c5c8041219bec65f259c754a/langsmith_wrappers-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fe8389dcb89ab83d6a6cc7e97278e52ba863256aa6306c243bfa490c55a956c3",
"md5": "9b25bbd9180484327d066311a5c5d46b",
"sha256": "897b051bddec05f1ba937f3b7427bf844ac305e53e95430ace768f9fe0ec1a54"
},
"downloads": -1,
"filename": "langsmith_wrappers-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "9b25bbd9180484327d066311a5c5d46b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4.0",
"size": 3428,
"upload_time": "2023-08-25T02:28:51",
"upload_time_iso_8601": "2023-08-25T02:28:51.254727Z",
"url": "https://files.pythonhosted.org/packages/fe/83/89dcb89ab83d6a6cc7e97278e52ba863256aa6306c243bfa490c55a956c3/langsmith_wrappers-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-25 02:28:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "langchain-ai",
"github_project": "langsmith-wrappers",
"github_not_found": true,
"lcname": "langsmith-wrappers"
}