kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
old-agentic-v1^2
rodzic
3d87b15d14
commit
6e823e7d97
|
@ -2,7 +2,7 @@ import { OpenAIClient } from '@agentic/openai-fetch'
|
|||
import 'dotenv/config'
|
||||
import { z } from 'zod'
|
||||
|
||||
import { Agentic, DiffbotTool, SerpAPITool } from '@/index'
|
||||
import { Agentic, SerpAPITool } from '@/index'
|
||||
|
||||
async function main() {
|
||||
const openai = new OpenAIClient({ apiKey: process.env.OPENAI_API_KEY! })
|
||||
|
@ -10,7 +10,7 @@ async function main() {
|
|||
|
||||
const res = await agentic
|
||||
.gpt4(`Summarize the latest news on {{topic}} using markdown.`)
|
||||
.tools([new SerpAPITool(), new DiffbotTool()])
|
||||
.tools([new SerpAPITool()])
|
||||
.input(
|
||||
z.object({
|
||||
topic: z.string()
|
||||
|
@ -25,7 +25,7 @@ async function main() {
|
|||
topic: 'HF0 accelerator'
|
||||
})
|
||||
|
||||
console.log(res)
|
||||
console.log('\n\n\n' + res)
|
||||
}
|
||||
|
||||
main()
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import defaultKy from 'ky'
|
||||
import { AbortError } from 'p-retry'
|
||||
import pThrottle from 'p-throttle'
|
||||
import { P } from 'pino'
|
||||
|
||||
import { throttleKy } from '@/utils'
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import { z } from 'zod'
|
|||
import * as types from '@/types'
|
||||
import { DiffbotClient } from '@/services/diffbot'
|
||||
import { BaseTask } from '@/task'
|
||||
import { omit, pick } from '@/utils'
|
||||
import { pick } from '@/utils'
|
||||
|
||||
export const DiffbotInputSchema = z.object({
|
||||
url: z.string().describe('URL of page to scrape')
|
||||
|
|
|
@ -12,7 +12,7 @@ export default defineConfig([
|
|||
minify: false,
|
||||
shims: true,
|
||||
dts: true,
|
||||
esbuildOptions(options, context) {
|
||||
esbuildOptions(options) {
|
||||
options.target = 'es2020'
|
||||
options.jsx = 'preserve'
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue