File size: 327 Bytes
d02575f
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
from langchain.chat_models import ChatOpenAI
from langchain.schema import (
    AIMessage,
    HumanMessage,
    SystemMessage
)

chat = ChatOpenAI(temperature=0.5)
print(
    chat([
        SystemMessage(content="你是一名优秀的数学老师"),
        HumanMessage(content="圆的面积怎么计算?"),
    ]).content)