(ctx context.Context)
| 27 | } |
| 28 | |
| 29 | func (c *localAIChatClient) ListModels(ctx context.Context) ([]string, error) { |
| 30 | resp, err := c.client.ListModels(ctx) |
| 31 | if err != nil { |
| 32 | return nil, err |
| 33 | } |
| 34 | |
| 35 | models := make([]string, 0, len(resp.Models)) |
| 36 | for _, model := range resp.Models { |
| 37 | if model.ID != "" { |
| 38 | models = append(models, model.ID) |
| 39 | } |
| 40 | } |
| 41 | sort.Strings(models) |
| 42 | return models, nil |
| 43 | } |
| 44 | |
| 45 | func (c *localAIChatClient) StreamChat(ctx context.Context, model string, messages []chatMessage, out io.Writer) (string, error) { |
| 46 | stream, err := c.client.CreateChatCompletionStream(ctx, openai.ChatCompletionRequest{ |
nothing calls this directly
no test coverage detected