Skip to content

Conversation

heimanba
Copy link
Contributor

@heimanba heimanba commented Oct 5, 2024

Title: add dashscope(alibabacloud) as new provider to gateway
DashScope is an AI solution provided by Alibaba Cloud. And is already compatible with the OpenAI interface, as mentioned here: https://help.aliyun.com/zh/model-studio/developer-reference/compatibility-of-openai-with-dashscope

Motivation: (optional)

  • Using gateway to call DashScope's AI large model

Related Issues: (optional)

Copy link
Collaborator

@narengogi narengogi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though I'm not able to verify this in my local (I have no way of signing up for an account on https://account.aliyun.com/register/qr_register.htm?oauth_callback=https%3A%2F%2Fdashscope.aliyun.com%2F )

@heimanba
Copy link
Contributor Author

heimanba commented Oct 7, 2024

LGTM, though I'm not able to verify this in my local (I have no way of signing up for an account on https://account.aliyun.com/register/qr_register.htm?oauth_callback=https%3A%2F%2Fdashscope.aliyun.com%2F )

test case

import { Portkey } from 'portkey-ai';

const portkey = new Portkey({
    apiKey: "ANTHROPIC_API_KEY",
		baseURL: "http://127.0.0.1:8787/v1",
		config:{
			model: "qwen-plus",
			"provider": "dashscope",
			api_key: "sk-xxx",
		}
});

const completion = await portkey.chat.completions.create({
	messages: [
			{ role: "system", content: "You are a helpful assistant." },
			{
					role: "user",
					content: "wo are you?",
			},
	],
});
console.log(completion.choices[0].message);

image

@VisargD VisargD merged commit 49c8227 into Portkey-AI:main Oct 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants