kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
docs: update variable names
rodzic
ee0c3cf967
commit
4ff22618a2
|
@ -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
|
||||||
})
|
})
|
||||||
|
|
Ładowanie…
Reference in New Issue