kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
old-agentic-v1^2
rodzic
6ff82a3ac1
commit
df18d69ed9
|
@ -10,28 +10,10 @@ async function main() {
|
|||
const openai = new OpenAIClient({ apiKey: process.env.OPENAI_API_KEY! })
|
||||
const $ = new Agentic({ openai })
|
||||
|
||||
// const ex0 = await $.gpt4(`give me a single boolean value`)
|
||||
// .output(z.boolean())
|
||||
// // .retry({ attempts: 3 })
|
||||
// .call()
|
||||
// console.log(ex0)
|
||||
|
||||
const ex1 = await $.gpt4(`generate fake data`)
|
||||
const example = await $.gpt4(`generate fake data`)
|
||||
.output(z.object({ foo: z.string(), bar: z.number() }))
|
||||
// .output(z.string())
|
||||
// .retry({ attempts: 3 })
|
||||
.call()
|
||||
console.log(ex1)
|
||||
|
||||
// const getBoolean = $.gpt4(`are you {{mood}}?`)
|
||||
// .input(z.object({ mood: z.string() }))
|
||||
// .output(z.boolean())
|
||||
|
||||
// const results = await Promise.all([
|
||||
// getBoolean.call({ mood: 'happy' }),
|
||||
// getBoolean.call({ mood: 'sad' })
|
||||
// ])
|
||||
// console.log(results)
|
||||
console.log(example)
|
||||
}
|
||||
|
||||
main()
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
import dotenv from 'dotenv-safe'
|
||||
import { OpenAIClient } from 'openai-fetch'
|
||||
import { z } from 'zod'
|
||||
|
||||
import { Agentic } from '../src'
|
||||
|
||||
dotenv.config()
|
||||
|
||||
async function main() {
|
||||
const openai = new OpenAIClient({ apiKey: process.env.OPENAI_API_KEY! })
|
||||
const $ = new Agentic({ openai })
|
||||
|
||||
const ex1 = await $.gpt4(`generate fake data`)
|
||||
// .output(z.object({ foo: z.string(), bar: z.number() }))
|
||||
.call()
|
||||
console.log(ex1)
|
||||
}
|
||||
|
||||
main()
|
Ładowanie…
Reference in New Issue