1, 插件商店
你可以直接在插件商店搜索302.AI,即可找到我们的官方插件。
添加到工作流后,输入302.AI后台-使用API-API Keys 生成的API KEY,即可使用
注意:
使用平台中ChatPro插件时,messages是一个Array,不是一个string,请使用代码执行器将消息拼接成数组后再传过来,否则会请求失败。
(系统提示词放在system里)
2. 创建插件
你也可以不选择使用插件商店的插件,自己进行创建
在个人空间-插件,选择右上角的导入
选择:URL和原始数据
复制以下内容:
info:
description: 302_AI
title: 302_AI
version: v1
openapi: 3.0.1
paths:
/v1/chat/completions:
post:
operationId: Chat
parameters:
- description: 302.AI管理后台-API超市-API管理,复制生成的API Key
in: header
name: Authorization
required: true
schema:
default: sk-xxx
type: string
requestBody:
content:
application/json:
schema:
properties:
message:
default: Hello
description: 发给LLM的消息
type: string
model:
default: gpt-4o
description: LLM的模型名
type: string
required:
- message
- model
type: object
responses:
"200":
content:
application/json:
schema:
properties:
output:
description: LLM的输出
type: string
type: object
description: new desc
default:
description: ""
summary: |-
和各个llm进行单轮对话。模型列表请查看302.AI官网API文档,国内国外开源模型全部支持。
仅需要输入model和message,即可获得output,是最简单的调用各种大模型的插件。
非常适合用在各种对文本能力要求高的工作流中,当作单纯的输入和输出流程使用。
servers:
- url: https://api.302.ai/v1/chat/completions
点击确认:
将插件启用,再点击调试:
输入302.AI后台-使用API-API Keys 生成的API KEY,点击运行,再点击完成
完成后,点击右上角的发布,再点击否,插件就可以在工作流中使用了。