Use Models Directly

This example shows how to use Athena’s language models for simple text generation when building with our Python SDK.

  • Use any model available in your workspace
  • Simple input/output for basic LLM calls
  • Get started with athena.agents.general.invoke()

This guide focuses on simple text generation. For multi-step workflows with tools like web browsing and search, see Build with Agents.

1

Install Package

!pip install -U athenaintel
2

Set Up Client

from athena import GeneralAgentConfig, GeneralAgentRequest
from athena.client import Athena
# Initialize client
athena = Athena(api_key="<YOUR_API_KEY>")
3

Basic Usage

For simple text generation, use the General Agent with no tools enabled:

# Create a simple request with no tools
config = GeneralAgentConfig(enabled_tools=[])
# Simple question
response = athena.agents.general.invoke(
request=GeneralAgentRequest(
config=config,
messages=[{"type": "human", "content": "What is the capital of France?"}]
)
)
# Get the response text
print(response.messages[-1].content)
4

Available Models

Specify models explicitly using the model parameter in the config. The default model is Claude.

Available models include:

  • claude_3_7_sonnet: Claude 3.7 Sonnet
  • claude_4_sonnet: Claude 4 Sonnet
  • claude_4_5_sonnet: Claude 4.5 Sonnet
  • claude_4_opus: Claude 4 Opus (default)
  • openai_gpt_4_5: OpenAI GPT-4.5 Preview
  • openai_gpt_4: OpenAI GPT-4
  • openai_gpt_4_turbo: OpenAI GPT-4 Turbo
  • openai_gpt_4_turbo_preview: OpenAI GPT-4 Turbo Preview
  • openai_gpt_4o: OpenAI GPT-4o
  • openai_gpt_4o_mini: OpenAI GPT-4o Mini
  • openai_gpt_5: OpenAI GPT-5
  • openai_gpt_5_pro: OpenAI GPT-5 Pro
  • openai_gpt_5_mini: OpenAI GPT-5 Mini
  • openai_o3_mini: OpenAI o3 Mini
  • openai_o3_low_reasoning: OpenAI o3 (Low Reasoning)
  • openai_o3_medium_reasoning: OpenAI o3 (Medium Reasoning)
  • openai_o3_high_reasoning: OpenAI o3 (High Reasoning)
  • openai_o3_mini_low_reasoning: OpenAI o3 Mini (Low Reasoning)
  • openai_o3_mini_high_reasoning: OpenAI o3 Mini (High Reasoning)
  • openai_o4_mini: OpenAI o4 Mini
# Specify a model
config = GeneralAgentConfig(
enabled_tools=[],
model="claude_3_7_sonnet"
)
response = athena.agents.general.invoke(
request=GeneralAgentRequest(
config=config,
messages=[{"type": "human", "content": "Who are you?"}]
)
)
print(response.messages[-1].content)
# Use another model
config_gpt4 = GeneralAgentConfig(
enabled_tools=[],
model="openai_gpt_4o"
)
response = athena.agents.general.invoke(
request=GeneralAgentRequest(
config=config_gpt4,
messages=[{"type": "human", "content": "Explain quantum computing briefly"}]
)
)
print(response.messages[-1].content)
5

Multiple Questions

Process multiple questions by making separate requests:

prompts = [
"Explain the theory of relativity",
"What is machine learning?",
"How does photosynthesis work?",
"Describe the water cycle"
]
config = GeneralAgentConfig(enabled_tools=[])
for i, prompt in enumerate(prompts):
response = athena.agents.general.invoke(
request=GeneralAgentRequest(
config=config,
messages=[{"type": "human", "content": prompt}]
)
)
print(f"Response {i+1}:")
print(response.messages[-1].content)
print("-" * 40)
6

Multi-turn Conversations

Maintain context by passing the full message history:

from langchain_core.messages import HumanMessage
from langchain_core.load import load
config = GeneralAgentConfig(enabled_tools=[])
# First message
response = athena.agents.general.invoke(
request=GeneralAgentRequest(
config=config,
messages=[{"type": "human", "content": "What is Python?"}]
)
)
# Continue the conversation with context
messages = load(response.messages) + [HumanMessage(content="What are its main use cases?")]
continued_response = athena.agents.general.invoke(
request=GeneralAgentRequest(
config=config,
messages=messages
)
)
print(continued_response.messages[-1].content)