-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
curl --location "https://api.minimaxi.chat/v1/text/chatcompletion_v2" \ | ||
--header "Content-Type: application/json" \ | ||
--header "Authorization: Bearer $MiniMax_API_KEY" \ | ||
--data '{ | ||
"model":"abab6.5s-chat", | ||
"messages":[ | ||
{ | ||
"role":"system", | ||
"name":"MM Intelligent Assistant", # Optional | ||
"content":"MM Intelligent Assistant is a large language model that is self-developed by MiniMax and does not call the interface of other products. " | ||
}, | ||
{ | ||
"role":"user", | ||
"name":"user", # Optional | ||
"content":"hello”" | ||
} | ||
] | ||
}' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# coding=utf-8 | ||
import dashscope | ||
|
||
messages = [{'role': 'system', 'content': 'You are a helpful assistant.'}, | ||
{'role': 'user', 'content': '你是谁'}] | ||
response = dashscope.Generation.call( | ||
model='abab6.5s-chat', | ||
messages=messages, | ||
) | ||
print(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from openai import OpenAI | ||
from dotenv import load_dotenv | ||
import os | ||
|
||
load_dotenv() | ||
STEP_API_KEY=os.getenv("STEP_API_KEY") | ||
client = OpenAI(api_key=STEP_API_KEY, base_url="https://api.stepfun.com/v1") | ||
|
||
completion = client.chat.completions.create( | ||
model="step-1-8k", | ||
messages=[ | ||
{ | ||
"role": "system", | ||
"content": "你是由阶跃星辰提供的AI聊天助手,你擅长中文,英文,以及多种其他语言的对话。在保证用户数据安全的前提下,你能对用户的问题和请求,作出快速和精准的回答。同时,你的回答和建议应该拒绝黄赌毒,暴力恐怖主义的内容", | ||
}, | ||
{"role": "user", "content": "你好,请介绍一下阶跃星辰的人工智能!"}, | ||
], | ||
) | ||
|
||
print(completion.choices[0].message.content) |