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