You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

26 regels
523 B

  1. package dto
  2. import (
  3. "github.com/QuantumNous/new-api/types"
  4. "github.com/gin-gonic/gin"
  5. )
  6. type Request interface {
  7. GetTokenCountMeta() *types.TokenCountMeta
  8. IsStream(c *gin.Context) bool
  9. SetModelName(modelName string)
  10. }
  11. type BaseRequest struct {
  12. }
  13. func (b *BaseRequest) GetTokenCountMeta() *types.TokenCountMeta {
  14. return &types.TokenCountMeta{
  15. TokenType: types.TokenTypeTokenizer,
  16. }
  17. }
  18. func (b *BaseRequest) IsStream(c *gin.Context) bool {
  19. return false
  20. }
  21. func (b *BaseRequest) SetModelName(modelName string) {}