Skip to content

Latest commit

 

History

History
60 lines (46 loc) · 1.01 KB

File metadata and controls

60 lines (46 loc) · 1.01 KB

阶跃星辰

通过环境变量设置调用参数

import os 
os.environ["STEPFUN_API_KEY"] = "your-stepfun-api-key"

非流式调用

from unionllm import unionchat

# model call
response = unionchat(
    provider="stepfun",
    model="step-1-8k", 
    messages = [{ "content": "Hello, how are you?","role": "user"}],
    stream=False
)

print(response)

流式调用

from unionllm import unionchat

# model call
response = unionchat(
    provider="stepfun",
    model="step-1-8k",
    messages = [{ "content": "Hello, how are you?","role": "user"}],
    stream=True
)

for chunk in response:
    print(chunk)

直接传入API_Key调用

# model call
response = unionchat(
    provider="stepfun",
    model="step-1-8k",
    api_key="your-stepfun-api-key",
    messages = [{ "content": "Hello, how are you?","role": "user"}]
)

支持模型

支持的所有模型

参考文档: