@@ -94,3 +94,33 @@ type ConfigureRequest struct {
9494 RawRuntimeFlags string `json:"raw-runtime-flags,omitempty"`
9595 Speculative * inference.SpeculativeDecodingConfig `json:"speculative,omitempty"`
9696}
97+
98+ // GenerateRequest represents the request structure for /api/generate endpoint
99+ type GenerateRequest struct {
100+ Model string `json:"model"`
101+ Prompt string `json:"prompt"`
102+ System string `json:"system,omitempty"`
103+ Template string `json:"template,omitempty"`
104+ Context []int `json:"context,omitempty"`
105+ Stream * bool `json:"stream,omitempty"`
106+ Raw bool `json:"raw,omitempty"`
107+ KeepAlive * int `json:"keep_alive,omitempty"`
108+ Options map [string ]interface {} `json:"options,omitempty"`
109+ }
110+
111+ // GenerateResponse represents the response structure for /api/generate endpoint
112+ type GenerateResponse struct {
113+ Model string `json:"model"`
114+ CreatedAt time.Time `json:"created_at"`
115+ Response string `json:"response"`
116+ Done bool `json:"done"`
117+ DoneReason string `json:"done_reason,omitempty"`
118+ Context []int `json:"context,omitempty"`
119+ TotalDuration int64 `json:"total_duration,omitempty"`
120+ LoadDuration int64 `json:"load_duration,omitempty"`
121+ PromptEvalCount int `json:"prompt_eval_count,omitempty"`
122+ PromptEvalDuration int64 `json:"prompt_eval_duration,omitempty"`
123+ EvalCount int `json:"eval_count,omitempty"`
124+ EvalDuration int64 `json:"eval_duration,omitempty"`
125+ }
126+
0 commit comments