后端docker 部署文件大改
This commit is contained in:
@@ -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."))
|
||||
Reference in New Issue
Block a user