Add references (removed inner git)

This commit is contained in:
hongz
2026-02-03 01:03:29 +08:00
parent 89d4260eb8
commit a44621558c
18 changed files with 2437 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
import os
from openai import OpenAI
XAI_API_KEY = os.getenv("XAI_API_KEY")
client = OpenAI(
api_key=XAI_API_KEY,
base_url="https://api.x.ai/v1",
)
completion = client.chat.completions.create(
model="grok-beta",
messages=[
{"role": "system", "content": "You are Grok, a chatbot inspired by the Hitchhikers Guide to the Galaxy."},
{"role": "user", "content": "What is the meaning of life, the universe, and everything?"},
],
)
print(completion.choices[0].message)