Skip to content

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 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REQUEST] 集成ZhipuAI AutoLog

2 participants