chat: reconcile history by canonical message identity
This commit is contained in:
@@ -195,6 +195,7 @@ func (c *Connection) Call(ctx context.Context, method, path string, body any) ([
|
||||
var request struct {
|
||||
Prompt string `json:"prompt"`
|
||||
Text string `json:"text"`
|
||||
ID string `json:"id"`
|
||||
Format json.RawMessage `json:"format"`
|
||||
Parts []struct {
|
||||
Text string `json:"text"`
|
||||
@@ -219,6 +220,9 @@ func (c *Connection) Call(ctx context.Context, method, path string, body any) ([
|
||||
}
|
||||
}
|
||||
payload := map[string]any{"model": c.models[id], "parts": []map[string]string{{"type": "text", "text": text}}}
|
||||
if request.ID != "" {
|
||||
payload["id"] = request.ID
|
||||
}
|
||||
if len(request.Format) > 0 {
|
||||
supported, err := c.supportsFormat(ctx, request.Format)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user