Skip to main content
Open In ColabOpen on GitHub

Solar

此社区集成已弃用。您应使用ChatUpstage来通过聊天模型连接器访问Solar LLM。

import os

from langchain_community.llms.solar import Solar

os.environ["SOLAR_API_KEY"] = "SOLAR_API_KEY"
llm = Solar()
llm.invoke("tell me a story?")
API Reference:Solar
from langchain.chains import LLMChain
from langchain_community.llms.solar import Solar
from langchain_core.prompts import PromptTemplate

template = """Question: {question}

Answer: Let's think step by step."""

prompt = PromptTemplate.from_template(template)

llm = Solar()
llm_chain = LLMChain(prompt=prompt, llm=llm)

question = "What NFL team won the Super Bowl in the year Justin Beiber was born?"

llm_chain.run(question)
API Reference:LLMChain | Solar | PromptTemplate

这个页面有帮助吗?