@@ -59,7 +59,7 @@ To create a new prompt or update an existing prompt, you can use the `push promp
59
59
60
60
<CodeTabs
61
61
tabs = { [
62
- PythonBlock (` from langsmith import client
62
+ PythonBlock (` from langsmith import Client
63
63
from langchain_core.prompts import ChatPromptTemplate\n
64
64
client = Client()\n
65
65
prompt = ChatPromptTemplate.from_template("tell me a joke about {topic}")
@@ -77,7 +77,9 @@ print(url)
77
77
TypeScriptBlock (` import * as hub from "langchain/hub";
78
78
import { ChatPromptTemplate } from "@langchain/core/prompts";\n
79
79
const prompt = ChatPromptTemplate.fromTemplate("tell me a joke about {topic}");
80
- const url = hub.push("joke-generator", chain);
80
+ const url = hub.push("joke-generator", {
81
+ object: prompt,
82
+ });
81
83
// url is a link to the prompt in the UI
82
84
console.log(url);
83
85
` ),
@@ -91,7 +93,7 @@ The provider must be supported by the LangSmith playground. (see settings here:
91
93
92
94
<CodeTabs
93
95
tabs = { [
94
- PythonBlock (` from langsmith import client
96
+ PythonBlock (` from langsmith import Client
95
97
from langchain_core.prompts import ChatPromptTemplate
96
98
from langchain_openai import ChatOpenAI\n
97
99
client = Client()
@@ -116,7 +118,9 @@ import { ChatOpenAI } from "@langchain/openai";\n
116
118
const model = new ChatOpenAI({ model: "gpt-4o-mini" });\n
117
119
const prompt = ChatPromptTemplate.fromTemplate("tell me a joke about {topic}");
118
120
const chain = prompt.pipe(model);\n
119
- await hub.push("joke-generator-with-model", chain); ` ),
121
+ await hub.push("joke-generator-with-model", {
122
+ object: chain
123
+ }); ` ),
120
124
]}
121
125
groupId = " client-language"
122
126
/>
@@ -131,7 +135,7 @@ To pull a **public prompt** from the LangChain Hub, you need to specify the hand
131
135
132
136
<CodeTabs
133
137
tabs = { [
134
- PythonBlock (` from langsmith import client
138
+ PythonBlock (` from langsmith import Client
135
139
from langchain_openai import ChatOpenAI\n
136
140
client = Client()\n
137
141
prompt = client.pull_prompt("joke-generator")
@@ -161,7 +165,7 @@ Make sure you have the proper environment variables set for the model you are us
161
165
162
166
<CodeTabs
163
167
tabs = { [
164
- PythonBlock (` from langsmith import client \n
168
+ PythonBlock (` from langsmith import Client \n
165
169
client = Client()
166
170
chain = client.pull_prompt("joke-generator-with-model", include_model=True)
167
171
chain.invoke({"topic": "cats"}) ` ),
0 commit comments