自定义连接器

自定义连接器

自定义Open AI Whisper连接器实现录音转文字

  • 在PowerApps左侧导航栏点击Custom connectors
  • 右上角点击Create from blank创建新的自定义连接器
  • 设置General页面
1
2
3
4
Scheme:
HTTPS
Host:
api.openai.com
  • 设置Security页面, OpenAI的认证方式为API Key,设置Authentication typeAPI Key
1
2
3
4
5
6
Parameter label:
API Key
Parameter name:
Authorization
Parameter location:
Header
  • 设置Definition页面
  • 点击New action创建新的操作, 设置如下参数
1
2
3
4
5
6
7
8
Summary:
Whisper
Description:
Whisper
Operation Id:
SpeechToText
Visibility:
none
  • 设置Request, 点击Import from sample, 设置如下
1
2
3
4
5
6
Verb:
POST
URL:
https://api.openai.com/v1/audio/transcriptions
Headers:
Content-Type multipart/form-data;
  • 设置Response, 点击Import from sample, 设置如下
1
2
3
{
"text": "大家好,我是米可爱分享."
}
  • 点击Swagger Editor,将下面的代码复制粘贴
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
swagger: '2.0'
info:
version: 1.0.0
title: OpenAI
description: OpenAI
host: api.openai.com
basePath: /
schemes:
- https
consumes: []
produces:
- application/json
paths:
/v1/audio/transcriptions:
post:
summary: Whisper
description: Whisper
operationId: SpeechToText
consumes:
- multipart/form-data
parameters:
- name: Content-Type
in: header
required: false
type: string
- name: file
in: formData
type: file
required: true
- name: filename
in: formData
type: string
required: true
- name: model
in: formData
type: string
required: true
responses:
default:
description: default
schema:
type: object
properties:
text:
type: string
description: text
definitions: {}
parameters: {}
responses: {}
securityDefinitions:
API Key:
type: apiKey
in: header
name: Authorization
security:
- API Key: []
tags: []
  • Code(Preview)不作操作,点击下一步
  • 点击Test创建新的连接测试。