Skip to content
👩‍🎨 Examples

Embedbase Snippets

This is a small collection of snippets to help you get started.

Using Embedbase with Internet Search Results

This examples makes it easy to inject search results inside your prompts.

const prompt = 'when did sam altman come to germany'
  
const results = await embedbase.internetSearch(prompt)
 
// merge helps make sure that your search result fits in your prompt!
const chunkedContext = await merge(results.map(formatInternetResultsInPrompt))
 
await embedbase.generate('${prompt} ${chunkedContext}').get()
// Sam Altman made his appearance in Germany on Thursday, 5/25/2023, at the Technical University of Munich (TUM) to speak about OpenAI and ChatGPT.