import os
os.environ["LINGYI_API_KEY"] = "your-lingyi-api-key"
from unionllm import unionchat
# model call
response = unionchat(
provider="lingyi",
model="yi-large",
messages = [{ "content": "Hello, how are you?","role": "user"}],
stream=False
)
print(response)
from unionllm import unionchat
# model call
response = unionchat(
provider="lingyi",
model="yi-large",
messages = [{ "content": "Hello, how are you?","role": "user"}],
stream=True
)
for chunk in response:
print(chunk)
# model call
response = unionchat(
provider="lingyi",
model="yi-large",
api_key="your-lingyi-api-key",
messages = [{ "content": "Hello, how are you?","role": "user"}]
)
支持零一万物的所有模型
参考文档: