Baichuan Inc. (https://www.baichuan-ai.com/) is a Chinese startup in the era of AGI, dedicated to addressing fundamental human needs: Efficiency, Health, and Happiness.
%pip install -qU langchain-community
Prerequisite
An API key is required to access Baichuan LLM API. Visit https://platform.baichuan-ai.com/ to get your API key.
Use Baichuan LLMimport os
os.environ["BAICHUAN_API_KEY"] = "YOUR_API_KEY"
from langchain_community.llms import BaichuanLLM
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())
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4