wip: refactoring tui
This commit is contained in:
@@ -17,33 +17,6 @@ func NewAgentServiceBridge(client *client.ClientWithResponses) *AgentServiceBrid
|
||||
return &AgentServiceBridge{client: client}
|
||||
}
|
||||
|
||||
// Run sends a message to the chat API
|
||||
func (a *AgentServiceBridge) Run(ctx context.Context, sessionID string, text string, attachments ...Attachment) (string, error) {
|
||||
// TODO: Handle attachments when API supports them
|
||||
if len(attachments) > 0 {
|
||||
// For now, ignore attachments
|
||||
// return "", fmt.Errorf("attachments not supported yet")
|
||||
}
|
||||
|
||||
part := client.MessagePart{}
|
||||
part.FromMessagePartText(client.MessagePartText{
|
||||
Type: "text",
|
||||
Text: text,
|
||||
})
|
||||
parts := []client.MessagePart{part}
|
||||
|
||||
go a.client.PostSessionChatWithResponse(ctx, client.PostSessionChatJSONRequestBody{
|
||||
SessionID: sessionID,
|
||||
Parts: parts,
|
||||
ProviderID: "anthropic",
|
||||
ModelID: "claude-sonnet-4-20250514",
|
||||
})
|
||||
|
||||
// The actual response will come through SSE
|
||||
// For now, just return success
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// Cancel cancels the current generation - NOT IMPLEMENTED IN API YET
|
||||
func (a *AgentServiceBridge) Cancel(sessionID string) error {
|
||||
// TODO: Not implemented in TypeScript API yet
|
||||
|
||||
Reference in New Issue
Block a user