workspace working

This commit is contained in:
2026-01-12 22:31:11 +08:00
parent 2738a822d1
commit 370fe6368a
149 changed files with 4648 additions and 660 deletions

26
test_deepseek_direct.py Normal file
View File

@@ -0,0 +1,26 @@
import os
import openai
from openai import AsyncOpenAI
# Set environment variables
os.environ["OPENAI_API_KEY"] = "sk-55f6e57f1d834b0e93ceaf98cc2cb715"
os.environ["OPENAI_API_BASE"] = "https://api.deepseek.com/v1"
client = AsyncOpenAI(
api_key=os.environ["OPENAI_API_KEY"],
base_url=os.environ["OPENAI_API_BASE"]
)
async def test():
try:
response = await client.chat.completions.create(
model="deepseek-chat",
messages=[{"role": "user", "content": "Hello"}],
max_tokens=10
)
print("Success:", response.choices[0].message.content)
except Exception as e:
print("Error:", e)
import asyncio
asyncio.run(test())