Travis Fischer 2023-05-26 17:47:59 -07:00
rodzic 861416072d
commit d8d333a648
1 zmienionych plików z 7 dodań i 10 usunięć

Wyświetl plik

@ -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()