后端docker 部署文件大改

This commit is contained in:
BBIT-Kai
2025-11-05 18:08:28 +08:00
parent 3d46cef3bd
commit 5a73018582
10 changed files with 143 additions and 49 deletions
+18
View File
@@ -0,0 +1,18 @@
import dspy
lm = dspy.LM("openai/deepseek-chat", api_key="sk-6129a200ae294b9f86553505191fa477", api_base="https://api.deepseek.com")
dspy.configure(lm=lm)
# print(lm("Say this is a test!", temperature=0.7)) # => ['This is a test!']
# print(lm(messages=[{"role": "user", "content": "Say this is a test!"}])) # => ['This is a test!']
from typing import Literal
class Classify(dspy.Signature):
"""Classify sentiment of a given sentence."""
sentence: str = dspy.InputField()
sentiment: Literal["positive", "negative", "neutral"] = dspy.OutputField()
confidence: float = dspy.OutputField()
classify = dspy.Predict(Classify)
print(classify(sentence="This book was super fun to read, though not the last chapter."))