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

Feat/integration zhipu ai #520

Merged
merged 2 commits into from
Apr 29, 2024
Merged

Feat/integration zhipu ai #520

merged 2 commits into from
Apr 29, 2024

Conversation

KashiwaByte
Copy link
Contributor

Description

集成Zhipu AI 实现chat_completion记录上传

Closes: #519

测试脚本如下:

from swanlab.integration.zhipuai import autolog


autolog(init=dict(experiment_name="zhipuai_logging", cloud=False))
client = autolog.client

response = client.chat.completions.create(
    model="glm-4",  # 填写需要调用的模型名称
    messages=[
        {"role": "user", "content": "作为一名营销专家,请为我的产品创作一个吸引人的slogan"},
        {"role": "assistant", "content": "当然,为了创作一个吸引人的slogan,请告诉我一些关于您产品的信息"},
        {"role": "user", "content": "智谱AI开放平台"},
        {"role": "assistant", "content": "智启未来,谱绘无限一智谱AI,让创新触手可及!"},
        {"role": "user", "content": "创造一个更精准、吸引人的slogan"},
    ],
)


response2 = client.chat.completions.create(
    model="glm-4",  # 填写需要调用的模型名称
    messages=[
        {"role": "user", "content": "谁获得了NBA2015年的总冠军"},
    ],
)

image
image

@KashiwaByte KashiwaByte added 💪 enhancement New feature or request 🌍 prepare for the future Feature prepare for the future labels Apr 28, 2024
@KashiwaByte KashiwaByte added this to the Integration milestone Apr 28, 2024
@Zeyi-Lin Zeyi-Lin self-requested a review April 28, 2024 12:45
@KashiwaByte KashiwaByte merged commit 39cb19b into main Apr 29, 2024
@KashiwaByte KashiwaByte deleted the feat/integration-ZhipuAI branch April 29, 2024 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request 🌍 prepare for the future Feature prepare for the future
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REQUEST] 集成ZhipuAI AutoLog
2 participants