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: add dashscope(alibabacloud) as new provider to gateway #663

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

heimanba
Copy link

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

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

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.

2 participants