Download dto/request_common.go from AZILS/new-api: direct link, hf CLI and curl.
- Browser
- Download file 523 Bytes
-
https://huggingface.co/spaces/AZILS/new-api/resolve/main/dto/request_common.go
- Command line
-
hf download hf://spaces/AZILS/new-api/dto/request_common.go
-
curl -L -o request_common.go https://huggingface.co/spaces/AZILS/new-api/resolve/main/dto/request_common.go
523 Bytes
| package dto | |
| import ( | |
| "github.com/QuantumNous/new-api/types" | |
| "github.com/gin-gonic/gin" | |
| ) | |
| type Request interface { | |
| GetTokenCountMeta() *types.TokenCountMeta | |
| IsStream(c *gin.Context) bool | |
| SetModelName(modelName string) | |
| } | |
| type BaseRequest struct { | |
| } | |
| func (b *BaseRequest) GetTokenCountMeta() *types.TokenCountMeta { | |
| return &types.TokenCountMeta{ | |
| TokenType: types.TokenTypeTokenizer, | |
| } | |
| } | |
| func (b *BaseRequest) IsStream(c *gin.Context) bool { | |
| return false | |
| } | |
| func (b *BaseRequest) SetModelName(modelName string) {} | |