You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
415 B
19 lines
415 B
from langchain_openai import ChatOpenAI
|
|
|
|
|
|
# llm对象就是调用大模型的对象
|
|
llm = ChatOpenAI(
|
|
model = "qwen3-8b",
|
|
base_url="http://localhost:6006/v1",
|
|
api_key="xxxx",
|
|
temperature=0.8,
|
|
);
|
|
# message是咱准备的问题信息
|
|
message = [
|
|
('system','你是一个智能助手'),
|
|
('human','来个相声报幕词')
|
|
]
|
|
# 调用大模型
|
|
resp = llm.invoke(message);
|
|
# 输出结果
|
|
print(resp) |