flag-checkeredGetting Started

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 of using the deep researcher. In this example, we'll use an event emitter with a print event handler, which allows us to see the deep research progress in real time.

circle-info

Each example uses the same research() interface while swapping out the underlying deep research provider. This allows different providers to be used interchangeably, without changing the calling logic that invokes the Component.

Each example follows the same flow:

  1. define a research query;

  2. invoke deep research using the same research() call;

  3. receive streamed progress and final results via an event emitter.

Below are minimal examples that perform deep research using the GL SDK:

  1. Obtain API Key (Contact the GL Open DeepResearch Team to obtain your API key). Configure it via the api_key argument or the environment variable.

export GLODR_API_KEY=...
  1. Run this code:

from dotenv import load_dotenv
load_dotenv()

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

query = "Create a concise report about why bananas are yellow."
event_emitter = EventEmitter.with_print_handler()

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

Expected Output

See more examples on GitHub

That’s it! You've just successfully used the deep researcher module!

Next Step

  1. Take a look into some additional capabilities of the deep researcher components in Customization & Capability

  2. Integrate deep research in a pipeline in

  3. Explore more about deep researcher subclasses and features in API reference pagearrow-up-right

Last updated

Was this helpful?