mirror of
https://github.com/tcsenpai/ollama.git
synced 2025-07-28 21:51:27 +00:00
transcribe
This commit is contained in:
parent
17f9dc6d08
commit
e4d35198a2
@ -82,6 +82,8 @@ type GenerateRequest struct {
|
|||||||
Options map[string]interface{} `json:"options"`
|
Options map[string]interface{} `json:"options"`
|
||||||
|
|
||||||
Audio string `json:"audio,omitempty"`
|
Audio string `json:"audio,omitempty"`
|
||||||
|
|
||||||
|
Transcribe bool `json:"transcribe,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChatRequest describes a request sent by [Client.Chat].
|
// ChatRequest describes a request sent by [Client.Chat].
|
||||||
|
@ -287,7 +287,17 @@ func (s *Server) GenerateHandler(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
req.Prompt = w.Text
|
if req.Transcribe {
|
||||||
|
c.JSON(http.StatusOK, api.GenerateResponse{
|
||||||
|
Model: req.Model,
|
||||||
|
CreatedAt: time.Now().UTC(),
|
||||||
|
Response: w.Text,
|
||||||
|
Done: true,
|
||||||
|
DoneReason: "stop",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
req.Prompt += w.Text
|
||||||
}
|
}
|
||||||
|
|
||||||
r, m, opts, err := s.scheduleRunner(c.Request.Context(), req.Model, caps, req.Options, req.KeepAlive)
|
r, m, opts, err := s.scheduleRunner(c.Request.Context(), req.Model, caps, req.Options, req.KeepAlive)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user