kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
rodzic
861416072d
commit
d8d333a648
|
@ -17,29 +17,26 @@ async function main() {
|
||||||
|
|
||||||
const $ = new Agentic({ openai })
|
const $ = new Agentic({ openai })
|
||||||
|
|
||||||
const searchResults = await metaphorSearch
|
const { results: searchResults } = await metaphorSearch.call({
|
||||||
.call({
|
query: 'news from today, 2023',
|
||||||
query: 'news from today',
|
numResults: 5
|
||||||
numResults: 5
|
})
|
||||||
})
|
|
||||||
.map((r) => r.result.title)
|
|
||||||
|
|
||||||
console.log('searchResults', searchResults)
|
console.log('searchResults', searchResults)
|
||||||
|
|
||||||
const foodAgent = await $.gpt4(
|
const foodAgent = await $.gpt4(
|
||||||
`Give me a summary of today's news. Here is what I got back from a search engine: {{searchResults.results}}`
|
`Give me a summary of today's news. Here is what I got back from a search engine: \n{{#searchResults}}{{title}}\n{{/searchResults}}`
|
||||||
)
|
)
|
||||||
.input(
|
.input(
|
||||||
z.object({
|
z.object({
|
||||||
searchResults: MetaphorSearchToolOutputSchema,
|
searchResults: z.any() // TODO
|
||||||
afaf: z.string()
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.output(
|
.output(
|
||||||
z.object({
|
z.object({
|
||||||
summary: z.string(),
|
summary: z.string(),
|
||||||
linkToLearnMore: z.string(),
|
linkToLearnMore: z.string(),
|
||||||
metaData: z.object({
|
metadata: z.object({
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
keyTopics: z.string().array(),
|
keyTopics: z.string().array(),
|
||||||
datePublished: z.string()
|
datePublished: z.string()
|
||||||
|
|
Ładowanie…
Reference in New Issue