from groq import Groq
import json

client = Groq()

response = client.chat.completions.create(
    model="groq/compound",
    messages=[
        {
            "role": "user",
            "content": "What happened in AI last week? Provide a list of the most important model releases and updates."
        }
    ]
)

# Final output
print(response.choices[0].message.content)

# Reasoning + internal tool calls
print(response.choices[0].message.reasoning)

# Search results from the tool calls
if response.choices[0].message.executed_tools:
    print(response.choices[0].message.executed_tools[0].search_results)

---

## Web Search