generated from songquanpeng/gin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: cloudflare support native openai api (#1596)
- Loading branch information
1 parent
d7a78f3
commit efd30a4
Showing
3 changed files
with
55 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,13 @@ | ||
package cloudflare | ||
|
||
type Request struct { | ||
Lora string `json:"lora,omitempty"` | ||
MaxTokens int `json:"max_tokens,omitempty"` | ||
Prompt string `json:"prompt,omitempty"` | ||
Raw bool `json:"raw,omitempty"` | ||
Stream bool `json:"stream,omitempty"` | ||
Temperature float64 `json:"temperature,omitempty"` | ||
} | ||
|
||
type Result struct { | ||
Response string `json:"response"` | ||
} | ||
import "github.com/songquanpeng/one-api/relay/model" | ||
|
||
type Response struct { | ||
Result Result `json:"result"` | ||
Success bool `json:"success"` | ||
Errors []string `json:"errors"` | ||
Messages []string `json:"messages"` | ||
} | ||
|
||
type StreamResponse struct { | ||
Response string `json:"response"` | ||
type Request struct { | ||
Messages []model.Message `json:"messages,omitempty"` | ||
Lora string `json:"lora,omitempty"` | ||
MaxTokens int `json:"max_tokens,omitempty"` | ||
Prompt string `json:"prompt,omitempty"` | ||
Raw bool `json:"raw,omitempty"` | ||
Stream bool `json:"stream,omitempty"` | ||
Temperature float64 `json:"temperature,omitempty"` | ||
} |