Skip to main content
  1. Install Danube
pip install danube
pip install openai
  1. Get API Key from Danube dashboard
  2. Set API Key in Danube
os.environ["DANUBE_API_KEY"] = "<API_KEY>"
os.environ["OPENAI_API_KEY"] = "<OPENAI_API_KEY>"
  1. Initialize the Danube client
from danube import Danube
from openai import OpenAI

danube = Danube()
openai = OpenAI()
  1. Set the system prompts
messages = [
    {"role": "system", "content": danube.system_prompt},
    {"role": "user", "content": danube.identity},
    {"role": "user", "content": "What are the top 5 stories on Hacker News?"},
]
  1. Provide your model with Danube tools
response = openai.chat.completions.create(
            model="gpt-4o",
            messages=messages,
            tools=danube.tools,
            tool_choice="auto",
            max_tokens=4000
        )