feat: rag
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from openai import OpenAI
|
||||
from dotenv import load_dotenv
|
||||
|
||||
import os
|
||||
load_dotenv()
|
||||
DATABASE_URL = os.getenv("DATABASE_URL")
|
||||
API_KEY = os.getenv("API_KEY")
|
||||
|
||||
|
||||
client = OpenAI(
|
||||
base_url=DATABASE_URL,
|
||||
api_key=API_KEY,
|
||||
)
|
||||
response = client.chat.completions.create(
|
||||
model="doubao-seed-1-6-lite-251015",
|
||||
messages=[
|
||||
{"role": "system", "content": "你是谁"},
|
||||
],
|
||||
)
|
||||
print(response)
|
||||
Reference in New Issue
Block a user