67人参与 • 2024-08-04 • 微信
今天我要给大家介绍团队的最新项目——一个集成了chatgpt-3.5/4.0
、claude3
、文心一言
、通义千问
、智谱ai
等多个ai模型的api模型聚合平台。仅需使用一个接口就可以对接所有ai模型
随着不同的ai模型陆续问世,每个模型都有其独特的优势和用途。但是,要同时与多个模型交互通常需要切换不同的平台和接口,这不仅耗时而且效率低下。
因此,团队萌生了一个想法:为什么不创建一个一站式的平台,让用户能够通过单一的接口与多个模型交流呢?这样,用户就可以轻松地比较不同模型的表现,并根据需要选择最合适的一个。于是诞生了这个api聚合平台-海鲸ai
海鲸ai支持的ai模型覆盖了当前市场上的多个主流选项,包括但不限于:
品牌 | 模型 |
---|---|
chatgpt | gpt-3.5-turbo,gpt-4-turbo,gpt-4-turbo-2024-04-09,gpt-4-1106-preview,gpt-4-vision-preview |
claude 3 | claude-3-sonnet-20240229,claude-3-opus-20240229,claude-3-haiku-20240307 |
文心一言 | ernie-3.5-8k |
通义千问 | qwen-turbo,qwen-plus,qwen-max |
智谱ai | glm-3-turbo,glm-4,glm-4v |
可通过登录api聚合平台获取apikey,登录后可获取5元的体验券,来调用api
通过一个接口即可对接国际主流ai模型,兼容性这边已经帮大家处理好了,无脑对接即可
api文档地址:https://api.atalk-ai.com/api#/operations/post-gpt-completions-messages
java
asynchttpclient client = new defaultasynchttpclient();
client.prepare("post", "https://api.atalk-ai.com/gpt/completions")
.setheader("authorization", "")
.setheader("content-type", "application/json")
.setbody("{\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"you are a helpful assistant.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"can i help you ?\"\n },\n {\n \"role\": \"user\",\n \"content\": \"hello!\"\n }\n ],\n \"model\": \"gpt-3.5-turbo\",\n \"max_tokens\": 1000,\n \"stream\": true,\n \"temperature\": 0.2\n}")
.execute()
.tocompletablefuture()
.thenaccept(system.out::println)
.join();
client.close();
python3
import http.client
conn = http.client.httpsconnection("api.atalk-ai.com")
payload = "{\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"you are a helpful assistant.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"can i help you ?\"\n },\n {\n \"role\": \"user\",\n \"content\": \"hello!\"\n }\n ],\n \"model\": \"gpt-3.5-turbo\",\n \"max_tokens\": 1000,\n \"stream\": true,\n \"temperature\": 0.2\n}"
headers = {
'authorization': "",
'content-type': "application/json"
}
conn.request("post", "/gpt/completions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
nodejs
const axios = require('axios').default;
const options = {
method: 'post',
url: 'https://api.atalk-ai.com/gpt/completions',
headers: {authorization: '', 'content-type': 'application/json'},
data: {
messages: [
{role: 'system', content: 'you are a helpful assistant.'},
{role: 'assistant', content: 'can i help you ?'},
{role: 'user', content: 'hello!'}
],
model: 'gpt-3.5-turbo',
max_tokens: 1000,
stream: true,
temperature: 0.2
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
php
<?php
$client = new \guzzlehttp\client();
$response = $client->request('post', 'https://api.atalk-ai.com/gpt/completions', [
'body' => '{
"messages": [
{
"role": "system",
"content": "you are a helpful assistant."
},
{
"role": "assistant",
"content": "can i help you ?"
},
{
"role": "user",
"content": "hello!"
}
],
"model": "gpt-3.5-turbo",
"max_tokens": 1000,
"stream": true,
"temperature": 0.2
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
],
]);
echo $response->getbody();
海鲸ai-api聚合平台是我们对ai技术无限探索的一次尝试。它不仅简化了与多个ai模型的交互过程,也为用户提供了一个高效、便捷的解决方案。我相信,随着ai技术的不断进步,海鲸ai将成为您实现创意和解决问题的得力助手。
您想发表意见!!点此发布评论
版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。
发表评论