Sync thread names from Codex
This commit is contained in:
@@ -203,6 +203,22 @@ func (c *Client) ResumeThread(ctx context.Context, threadID string) (Thread, err
|
||||
return result.Thread, nil
|
||||
}
|
||||
|
||||
func (c *Client) ReadThread(ctx context.Context, threadID string) (Thread, error) {
|
||||
if err := c.EnsureConnected(ctx); err != nil {
|
||||
return Thread{}, err
|
||||
}
|
||||
var result struct {
|
||||
Thread Thread `json:"thread"`
|
||||
}
|
||||
if err := c.call(ctx, "thread/read", map[string]any{
|
||||
"threadId": threadID,
|
||||
"includeTurns": false,
|
||||
}, &result); err != nil {
|
||||
return Thread{}, err
|
||||
}
|
||||
return result.Thread, nil
|
||||
}
|
||||
|
||||
func (c *Client) ForkThread(ctx context.Context, threadID string) (Thread, error) {
|
||||
if err := c.EnsureConnected(ctx); err != nil {
|
||||
return Thread{}, err
|
||||
|
||||
Reference in New Issue
Block a user