This commit is contained in:
Sakurasan
2023-05-30 12:52:09 +08:00
parent df4e86ae5f
commit cc3e735cbd
2 changed files with 1 additions and 55 deletions

View File

@@ -3,7 +3,7 @@ WORKDIR /frontend-build
COPY ./web/ . COPY ./web/ .
RUN npm install && npm run build && rm -rf node_modules RUN npm install && npm run build && rm -rf node_modules
FROM golang:1.19.7-alpine as builder FROM golang:1.19-alpine as builder
LABEL anther="github.com/Sakurasan" LABEL anther="github.com/Sakurasan"
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk --no-cache add make cmake upx RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk --no-cache add make cmake upx
WORKDIR /build WORKDIR /build

View File

@@ -1,54 +0,0 @@
/*
https://learn.microsoft.com/zh-cn/azure/cognitive-services/openai/chatgpt-quickstart
curl $AZURE_OPENAI_ENDPOINT/openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-03-15-preview \
-H "Content-Type: application/json" \
-H "api-key: $AZURE_OPENAI_KEY" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "你好"}]
}'
*/
package azureopenai
import (
"fmt"
"testing"
)
func TestModels(t *testing.T) {
type args struct {
endpoint string
apikey string
}
tests := []struct {
name string
args args
}{
{
name: "test",
args: args{
endpoint: "https://mirrors2.openai.azure.com",
apikey: "696a7729234c438cb38f24da22ee602d",
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := Models(tt.args.endpoint, tt.args.apikey)
if err != nil {
t.Errorf("Models() error = %v", err)
return
}
for _, data := range got.Data {
fmt.Println(data.Model, data.ID)
}
})
}
}
// curl https://mirrors2.openai.azure.com/openai/deployments?api-version=2023-03-15-preview \
// -H "Content-Type: application/json" \
// -H "api-key: 696a7729234c438cb38f24da22ee602d"