Skip to content

Commit

Permalink
mmmm
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaomingX committed Jan 10, 2025
1 parent 2957bc3 commit b0f2b2f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/llm/minimax_demo/README.md
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”"
}
]
}'

10 changes: 10 additions & 0 deletions src/llm/minimax_demo/main.py
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)
20 changes: 20 additions & 0 deletions src/llm/stepfun_demo/main.py
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)

0 comments on commit b0f2b2f

Please sign in to comment.