docs: update variable names

old-agentic-v1^2
Philipp Burckhardt 2023-06-14 15:57:15 -04:00 zatwierdzone przez Travis Fischer
rodzic ee0c3cf967
commit 4ff22618a2
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -9,7 +9,7 @@ async function main() {
const openai = new OpenAIClient({ apiKey: process.env.OPENAI_API_KEY! }) const openai = new OpenAIClient({ apiKey: process.env.OPENAI_API_KEY! })
const ai = new Agentic({ openai }) const ai = new Agentic({ openai })
const topicFacts = ai const topicJokes = ai
.gpt3(`Tell me {{num}} jokes about {{topic}}`) .gpt3(`Tell me {{num}} jokes about {{topic}}`)
.input( .input(
z.object({ z.object({
@ -20,7 +20,7 @@ async function main() {
.output(z.array(z.string())) .output(z.array(z.string()))
.modelParams({ temperature: 0.9 }) .modelParams({ temperature: 0.9 })
const topicFactsFeedback = withHumanFeedback(topicFacts, { const topicJokesFeedback = withHumanFeedback(topicJokes, {
type: 'selectN', type: 'selectN',
annotations: false, annotations: false,
bail: false, bail: false,
@ -28,7 +28,7 @@ async function main() {
mechanism: HumanFeedbackMechanismCLI mechanism: HumanFeedbackMechanismCLI
}) })
const out = await topicFactsFeedback.callWithMetadata({ const out = await topicJokesFeedback.callWithMetadata({
topic: 'politicians', topic: 'politicians',
num: 5 num: 5
}) })