LangChain V1.0 릴리즈 이후 공식 도큐먼트의 한글 번역본 입니다. 번역 오류는 Issue 에 올려주세요 🙇♂️
한국어
Python
##Installing the langchain packages needed to use the integration pip install -qU langchain-community
import os os.environ["BAICHUAN_API_KEY"] = "YOUR_API_KEY"
from langchain_community.llms import BaichuanLLM # Load the model llm = BaichuanLLM() res = llm.invoke("What's your name?") print(res)
res = llm.generate(prompts=["你好!"]) res
for res in llm.stream("Who won the second world war?"): print(res)
import asyncio async def run_aio_stream(): async for res in llm.astream("Write a poem about the sun."): print(res) asyncio.run(run_aio_stream())