Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议在服务提供商配置里加入Kimi(MoonShot)服务商,因为Kimi的API是免费的 #446

Closed
1 of 2 tasks
Light0913 opened this issue Feb 9, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@Light0913
Copy link

Light0913 commented Feb 9, 2025

描述

建议在服务提供商配置里加入Kimi(MoonShot)服务商,因为Kimi的API是免费的

Kimi的API url:https://api.moonshot.cn/v1

用Python的OpenAI库创建例子

AI_Client = OpenAI(
    api_key = "{API_KEY}",
    base_url = "https://api.moonshot.cn/v1",
)
history = [
    {"role": "system", "content": "{training_text}"}
]

completion = client.chat.completions.create(
    model = "moonshot-v1-8k",
    messages = history,
    temperature = 0.3,
    )
    result = completion.choices[0].message.content

使用场景

No response

你愿意提交PR吗?

  • 是的, 我愿意提交PR!

Code of Conduct

@Light0913 Light0913 added the enhancement New feature or request label Feb 9, 2025
Soulter added a commit that referenced this issue Feb 10, 2025
@Soulter
Copy link
Owner

Soulter commented Feb 11, 2025

已经加入。

@Soulter Soulter closed this as completed Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants