File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -2,15 +2,13 @@ import { serve } from "https://deno.land/std@0.181.0/http/server.ts";
2
2
3
3
// The name of your Azure OpenAI Resource.
4
4
const resourceName :string = "your-resource-name" ;
5
-
6
- // The deployment name you chose when you deployed the model.
7
- // const deployName:string = "deployment-name";
8
-
5
+ // The version of OpenAI API.
9
6
const apiVersion :string = "2023-03-15-preview" ;
10
- // 自定义 mapper 来映射 model 字段
7
+ // The mapping of model name.
11
8
const mapper :any = {
12
- 'gpt-3.5-turbo' : 'gpt35'
13
- // 其他映射规则可以在这里添加
9
+ 'gpt-3.5-turbo' : 'gpt35' ,
10
+ 'gpt-4' : 'gpt4'
11
+ // Other mapping rules can be added here.
14
12
} ;
15
13
16
14
async function handleRequest ( request :Request ) :Promise < Response > {
@@ -31,7 +29,7 @@ async function handleRequest(request:Request):Promise<Response> {
31
29
}
32
30
33
31
34
- // 获取 model 字段的值,并进行映射
32
+ // Get the value of the model field and perform mapping.
35
33
let deployName :string = '' ;
36
34
let body :any ;
37
35
if ( request . method === 'POST' ) {
You can’t perform that action at this time.
0 commit comments