landmark-magnifying-glassDeep Researcher

gllm-generationarrow-up-right | Involves LM | Tutorial: Reference Formatter | API Referencearrow-up-right

What’s a Deep Researcher?

The deep researcher is component designed to perform a deep research operation in an RAG pipeline response with ease. In this tutorial, you'll learn how to use the OpenAIDeepResearcher in just a few lines of code. You can also explore other types of deep researchers, available herearrow-up-right.

chevron-rightPrerequisiteshashtag

This example specifically requires completion of all setup steps listed on the Prerequisites page.

You should be familiar with these concepts:

Installation

# you can use a Conda environment
pip install --extra-index-url https://oauth2accesstoken:$(gcloud auth print-access-token)@glsdk.gdplabs.id/gen-ai-internal/simple/ "gllm-generation"

Quickstart

Let’s jump into a basic example using OpenAIDeepResearcher. In this example, we will use an event emitter with a print event handler, which allows us to see the deep research progress in real time:

from dotenv import load_dotenv
load_dotenv()

import asyncio
from gllm_core.event import EventEmitter
from gllm_generation.deep_researcher import OpenAIDeepResearcher

query = "Create a short and concise report about why banana is yellow."
event_emitter = EventEmitter.with_print_handler()

deep_researcher = OpenAIDeepResearcher()
asyncio.run(deep_researcher.research(query=query, event_emitter=event_emitter))

Expected Output

That’s it! You've just successfully used the OpenAIDeepResearcher! If you'd like, you can also try to play around by customizing the available parameters according to your needs!

Last updated