MAESTRO: i18n: extract hard-coded strings from internal/plugins/ai/lmstudio/lmstudio.go

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kayvan Sylvan
2026-02-13 23:38:16 -08:00
parent 5fbddb2279
commit 7382ddaae5
11 changed files with 162 additions and 41 deletions

View File

@@ -350,5 +350,17 @@
"extension_invalid_timeout": "ungültiger Zeitlimit-Wert '%s': muss eine Dauer wie '30s' oder '1m' sein: %w",
"extension_registered_success": "Erweiterung erfolgreich registriert:\n",
"extension_name_detail_label": "Name: %s\n",
"extension_failed_remove": "Erweiterung konnte nicht entfernt werden: %w"
"extension_failed_remove": "Erweiterung konnte nicht entfernt werden: %w",
"lmstudio_api_url_question": "Geben Sie Ihre %v URL ein (zur Erinnerung, sie ist normalerweise %v)",
"lmstudio_failed_create_request": "Anfrage konnte nicht erstellt werden: %w",
"lmstudio_failed_send_request": "Anfrage konnte nicht gesendet werden: %w",
"lmstudio_unexpected_status_code": "Unerwarteter Statuscode: %d",
"lmstudio_failed_decode_response": "Antwort konnte nicht dekodiert werden: %w",
"lmstudio_failed_marshal_payload": "Nutzlast konnte nicht serialisiert werden: %w",
"lmstudio_error_reading_response": "Fehler beim Lesen der Antwort: %w",
"lmstudio_invalid_response_missing_choices": "Ungültiges Antwortformat: Auswahlmöglichkeiten fehlen oder sind leer",
"lmstudio_invalid_response_missing_message": "Ungültiges Antwortformat: Nachricht in der ersten Auswahl fehlt",
"lmstudio_invalid_response_missing_content": "Ungültiges Antwortformat: Inhalt in der Nachricht fehlt oder ist kein String",
"lmstudio_invalid_response_missing_text": "Ungültiges Antwortformat: Text in der ersten Auswahl fehlt oder ist kein String",
"lmstudio_no_embeddings_returned": "Keine Einbettungen zurückgegeben"
}

View File

@@ -350,5 +350,17 @@
"extension_invalid_timeout": "invalid timeout value '%s': must be a duration like '30s' or '1m': %w",
"extension_registered_success": "Successfully registered extension:\n",
"extension_name_detail_label": "Name: %s\n",
"extension_failed_remove": "failed to remove extension: %w"
"extension_failed_remove": "failed to remove extension: %w",
"lmstudio_api_url_question": "Enter your %v URL (as a reminder, it is usually %v)",
"lmstudio_failed_create_request": "failed to create request: %w",
"lmstudio_failed_send_request": "failed to send request: %w",
"lmstudio_unexpected_status_code": "unexpected status code: %d",
"lmstudio_failed_decode_response": "failed to decode response: %w",
"lmstudio_failed_marshal_payload": "failed to marshal payload: %w",
"lmstudio_error_reading_response": "error reading response: %w",
"lmstudio_invalid_response_missing_choices": "invalid response format: missing or empty choices",
"lmstudio_invalid_response_missing_message": "invalid response format: missing message in first choice",
"lmstudio_invalid_response_missing_content": "invalid response format: missing or non-string content in message",
"lmstudio_invalid_response_missing_text": "invalid response format: missing or non-string text in first choice",
"lmstudio_no_embeddings_returned": "no embeddings returned"
}

View File

@@ -350,5 +350,17 @@
"extension_invalid_timeout": "valor de tiempo límite inválido '%s': debe ser una duración como '30s' o '1m': %w",
"extension_registered_success": "Extensión registrada exitosamente:\n",
"extension_name_detail_label": "Nombre: %s\n",
"extension_failed_remove": "error al eliminar la extensión: %w"
"extension_failed_remove": "error al eliminar la extensión: %w",
"lmstudio_api_url_question": "Introduzca su URL de %v (como recordatorio, generalmente es %v)",
"lmstudio_failed_create_request": "error al crear la solicitud: %w",
"lmstudio_failed_send_request": "error al enviar la solicitud: %w",
"lmstudio_unexpected_status_code": "código de estado inesperado: %d",
"lmstudio_failed_decode_response": "error al decodificar la respuesta: %w",
"lmstudio_failed_marshal_payload": "error al serializar la carga útil: %w",
"lmstudio_error_reading_response": "error al leer la respuesta: %w",
"lmstudio_invalid_response_missing_choices": "formato de respuesta inválido: opciones ausentes o vacías",
"lmstudio_invalid_response_missing_message": "formato de respuesta inválido: mensaje ausente en la primera opción",
"lmstudio_invalid_response_missing_content": "formato de respuesta inválido: contenido ausente o no es una cadena en el mensaje",
"lmstudio_invalid_response_missing_text": "formato de respuesta inválido: texto ausente o no es una cadena en la primera opción",
"lmstudio_no_embeddings_returned": "no se devolvieron incrustaciones"
}

View File

@@ -342,5 +342,17 @@
"extension_invalid_timeout": "مقدار مهلت زمانی نامعتبر '%s': باید مدت‌زمانی مانند '30s' یا '1m' باشد: %w",
"extension_registered_success": "افزونه با موفقیت ثبت شد:\n",
"extension_name_detail_label": "نام: %s\n",
"extension_failed_remove": "حذف افزونه ناموفق بود: %w"
"extension_failed_remove": "حذف افزونه ناموفق بود: %w",
"lmstudio_api_url_question": "آدرس URL %v خود را وارد کنید (به عنوان یادآوری، معمولاً %v است)",
"lmstudio_failed_create_request": "ایجاد درخواست ناموفق بود: %w",
"lmstudio_failed_send_request": "ارسال درخواست ناموفق بود: %w",
"lmstudio_unexpected_status_code": "کد وضعیت غیرمنتظره: %d",
"lmstudio_failed_decode_response": "رمزگشایی پاسخ ناموفق بود: %w",
"lmstudio_failed_marshal_payload": "سریال‌سازی بار داده ناموفق بود: %w",
"lmstudio_error_reading_response": "خطا در خواندن پاسخ: %w",
"lmstudio_invalid_response_missing_choices": "فرمت پاسخ نامعتبر: گزینه‌ها وجود ندارند یا خالی هستند",
"lmstudio_invalid_response_missing_message": "فرمت پاسخ نامعتبر: پیام در اولین گزینه وجود ندارد",
"lmstudio_invalid_response_missing_content": "فرمت پاسخ نامعتبر: محتوا در پیام وجود ندارد یا رشته نیست",
"lmstudio_invalid_response_missing_text": "فرمت پاسخ نامعتبر: متن در اولین گزینه وجود ندارد یا رشته نیست",
"lmstudio_no_embeddings_returned": "هیچ بردار جاسازی بازگردانده نشد"
}

View File

@@ -350,5 +350,17 @@
"extension_invalid_timeout": "valeur de délai invalide '%s' : doit être une durée comme '30s' ou '1m' : %w",
"extension_registered_success": "Extension enregistrée avec succès :\n",
"extension_name_detail_label": "Nom : %s\n",
"extension_failed_remove": "échec de la suppression de l'extension : %w"
"extension_failed_remove": "échec de la suppression de l'extension : %w",
"lmstudio_api_url_question": "Entrez votre URL %v (pour rappel, elle est généralement %v)",
"lmstudio_failed_create_request": "échec de la création de la requête : %w",
"lmstudio_failed_send_request": "échec de l'envoi de la requête : %w",
"lmstudio_unexpected_status_code": "code de statut inattendu : %d",
"lmstudio_failed_decode_response": "échec du décodage de la réponse : %w",
"lmstudio_failed_marshal_payload": "échec de la sérialisation des données : %w",
"lmstudio_error_reading_response": "erreur lors de la lecture de la réponse : %w",
"lmstudio_invalid_response_missing_choices": "format de réponse invalide : choix manquants ou vides",
"lmstudio_invalid_response_missing_message": "format de réponse invalide : message manquant dans le premier choix",
"lmstudio_invalid_response_missing_content": "format de réponse invalide : contenu manquant ou non-chaîne dans le message",
"lmstudio_invalid_response_missing_text": "format de réponse invalide : texte manquant ou non-chaîne dans le premier choix",
"lmstudio_no_embeddings_returned": "aucun embedding retourné"
}

View File

@@ -350,5 +350,17 @@
"extension_invalid_timeout": "valore di timeout non valido '%s': deve essere una durata come '30s' o '1m': %w",
"extension_registered_success": "Estensione registrata con successo:\n",
"extension_name_detail_label": "Nome: %s\n",
"extension_failed_remove": "impossibile rimuovere l'estensione: %w"
"extension_failed_remove": "impossibile rimuovere l'estensione: %w",
"lmstudio_api_url_question": "Inserisci il tuo URL %v (come promemoria, di solito è %v)",
"lmstudio_failed_create_request": "impossibile creare la richiesta: %w",
"lmstudio_failed_send_request": "impossibile inviare la richiesta: %w",
"lmstudio_unexpected_status_code": "codice di stato imprevisto: %d",
"lmstudio_failed_decode_response": "impossibile decodificare la risposta: %w",
"lmstudio_failed_marshal_payload": "impossibile serializzare il payload: %w",
"lmstudio_error_reading_response": "errore durante la lettura della risposta: %w",
"lmstudio_invalid_response_missing_choices": "formato di risposta non valido: scelte mancanti o vuote",
"lmstudio_invalid_response_missing_message": "formato di risposta non valido: messaggio mancante nella prima scelta",
"lmstudio_invalid_response_missing_content": "formato di risposta non valido: contenuto mancante o non stringa nel messaggio",
"lmstudio_invalid_response_missing_text": "formato di risposta non valido: testo mancante o non stringa nella prima scelta",
"lmstudio_no_embeddings_returned": "nessun embedding restituito"
}

View File

@@ -350,5 +350,17 @@
"extension_invalid_timeout": "無効なタイムアウト値 '%s': '30s' や '1m' のような期間である必要があります: %w",
"extension_registered_success": "拡張機能が正常に登録されました:\n",
"extension_name_detail_label": "名前: %s\n",
"extension_failed_remove": "拡張機能の削除に失敗しました: %w"
"extension_failed_remove": "拡張機能の削除に失敗しました: %w",
"lmstudio_api_url_question": "%v の URL を入力してください(通常は %v です)",
"lmstudio_failed_create_request": "リクエストの作成に失敗しました: %w",
"lmstudio_failed_send_request": "リクエストの送信に失敗しました: %w",
"lmstudio_unexpected_status_code": "予期しないステータスコード: %d",
"lmstudio_failed_decode_response": "レスポンスのデコードに失敗しました: %w",
"lmstudio_failed_marshal_payload": "ペイロードのシリアル化に失敗しました: %w",
"lmstudio_error_reading_response": "レスポンスの読み取りエラー: %w",
"lmstudio_invalid_response_missing_choices": "無効なレスポンス形式: 選択肢がないか空です",
"lmstudio_invalid_response_missing_message": "無効なレスポンス形式: 最初の選択肢にメッセージがありません",
"lmstudio_invalid_response_missing_content": "無効なレスポンス形式: メッセージにコンテンツがないか文字列ではありません",
"lmstudio_invalid_response_missing_text": "無効なレスポンス形式: 最初の選択肢にテキストがないか文字列ではありません",
"lmstudio_no_embeddings_returned": "埋め込みが返されませんでした"
}

View File

@@ -350,5 +350,17 @@
"extension_invalid_timeout": "valor de tempo limite inválido '%s': deve ser uma duração como '30s' ou '1m': %w",
"extension_registered_success": "Extensão registrada com sucesso:\n",
"extension_name_detail_label": "Nome: %s\n",
"extension_failed_remove": "falha ao remover a extensão: %w"
"extension_failed_remove": "falha ao remover a extensão: %w",
"lmstudio_api_url_question": "Digite sua URL %v (como lembrete, geralmente é %v)",
"lmstudio_failed_create_request": "falha ao criar a requisição: %w",
"lmstudio_failed_send_request": "falha ao enviar a requisição: %w",
"lmstudio_unexpected_status_code": "código de status inesperado: %d",
"lmstudio_failed_decode_response": "falha ao decodificar a resposta: %w",
"lmstudio_failed_marshal_payload": "falha ao serializar o payload: %w",
"lmstudio_error_reading_response": "erro ao ler a resposta: %w",
"lmstudio_invalid_response_missing_choices": "formato de resposta inválido: escolhas ausentes ou vazias",
"lmstudio_invalid_response_missing_message": "formato de resposta inválido: mensagem ausente na primeira escolha",
"lmstudio_invalid_response_missing_content": "formato de resposta inválido: conteúdo ausente ou não é uma string na mensagem",
"lmstudio_invalid_response_missing_text": "formato de resposta inválido: texto ausente ou não é uma string na primeira escolha",
"lmstudio_no_embeddings_returned": "nenhum embedding retornado"
}

View File

@@ -350,5 +350,17 @@
"extension_invalid_timeout": "valor de tempo limite inválido '%s': deve ser uma duração como '30s' ou '1m': %w",
"extension_registered_success": "Extensão registada com sucesso:\n",
"extension_name_detail_label": "Nome: %s\n",
"extension_failed_remove": "falha ao remover a extensão: %w"
"extension_failed_remove": "falha ao remover a extensão: %w",
"lmstudio_api_url_question": "Introduza o seu URL %v (como lembrete, geralmente é %v)",
"lmstudio_failed_create_request": "falha ao criar o pedido: %w",
"lmstudio_failed_send_request": "falha ao enviar o pedido: %w",
"lmstudio_unexpected_status_code": "código de estado inesperado: %d",
"lmstudio_failed_decode_response": "falha ao descodificar a resposta: %w",
"lmstudio_failed_marshal_payload": "falha ao serializar os dados: %w",
"lmstudio_error_reading_response": "erro ao ler a resposta: %w",
"lmstudio_invalid_response_missing_choices": "formato de resposta inválido: escolhas ausentes ou vazias",
"lmstudio_invalid_response_missing_message": "formato de resposta inválido: mensagem ausente na primeira escolha",
"lmstudio_invalid_response_missing_content": "formato de resposta inválido: conteúdo ausente ou não é uma string na mensagem",
"lmstudio_invalid_response_missing_text": "formato de resposta inválido: texto ausente ou não é uma string na primeira escolha",
"lmstudio_no_embeddings_returned": "nenhum embedding retornado"
}

View File

@@ -350,5 +350,17 @@
"extension_invalid_timeout": "无效的超时值 '%s':必须是 '30s' 或 '1m' 等时间格式:%w",
"extension_registered_success": "扩展注册成功:\n",
"extension_name_detail_label": "名称:%s\n",
"extension_failed_remove": "删除扩展失败:%w"
"extension_failed_remove": "删除扩展失败:%w",
"lmstudio_api_url_question": "请输入您的 %v URL提醒一下通常是 %v",
"lmstudio_failed_create_request": "创建请求失败:%w",
"lmstudio_failed_send_request": "发送请求失败:%w",
"lmstudio_unexpected_status_code": "意外的状态码:%d",
"lmstudio_failed_decode_response": "解码响应失败:%w",
"lmstudio_failed_marshal_payload": "序列化负载失败:%w",
"lmstudio_error_reading_response": "读取响应时出错:%w",
"lmstudio_invalid_response_missing_choices": "无效的响应格式:选项缺失或为空",
"lmstudio_invalid_response_missing_message": "无效的响应格式:第一个选项中缺少消息",
"lmstudio_invalid_response_missing_content": "无效的响应格式:消息中的内容缺失或不是字符串",
"lmstudio_invalid_response_missing_text": "无效的响应格式:第一个选项中的文本缺失或不是字符串",
"lmstudio_no_embeddings_returned": "未返回嵌入向量"
}

View File

@@ -12,6 +12,7 @@ import (
"github.com/danielmiessler/fabric/internal/chat"
"github.com/danielmiessler/fabric/internal/domain"
"github.com/danielmiessler/fabric/internal/i18n"
"github.com/danielmiessler/fabric/internal/plugins"
)
@@ -29,7 +30,7 @@ func NewClientCompatible(vendorName string, defaultBaseUrl string, configureCust
}
ret.PluginBase = plugins.NewVendorPluginBase(vendorName, configureCustom)
ret.ApiUrl = ret.AddSetupQuestionCustom("API URL", true,
fmt.Sprintf("Enter your %v URL (as a reminder, it is usually %v')", vendorName, defaultBaseUrl))
fmt.Sprintf(i18n.T("lmstudio_api_url_question"), vendorName, defaultBaseUrl))
return
}
@@ -52,17 +53,17 @@ func (c *Client) ListModels() ([]string, error) {
req, err := http.NewRequest("GET", url, nil)
if err != nil {
return nil, fmt.Errorf("failed to create request: %w", err)
return nil, fmt.Errorf(i18n.T("lmstudio_failed_create_request"), err)
}
resp, err := c.HttpClient.Do(req)
if err != nil {
return nil, fmt.Errorf("failed to send request: %w", err)
return nil, fmt.Errorf(i18n.T("lmstudio_failed_send_request"), err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("unexpected status code: %d", resp.StatusCode)
return nil, fmt.Errorf(i18n.T("lmstudio_unexpected_status_code"), resp.StatusCode)
}
var result struct {
@@ -72,7 +73,7 @@ func (c *Client) ListModels() ([]string, error) {
}
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
return nil, fmt.Errorf("failed to decode response: %w", err)
return nil, fmt.Errorf(i18n.T("lmstudio_failed_decode_response"), err)
}
models := make([]string, len(result.Data))
@@ -97,13 +98,13 @@ func (c *Client) SendStream(msgs []*chat.ChatCompletionMessage, opts *domain.Cha
var jsonPayload []byte
if jsonPayload, err = json.Marshal(payload); err != nil {
err = fmt.Errorf("failed to marshal payload: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_marshal_payload"), err)
return
}
var req *http.Request
if req, err = http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload)); err != nil {
err = fmt.Errorf("failed to create request: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_create_request"), err)
return
}
@@ -111,13 +112,13 @@ func (c *Client) SendStream(msgs []*chat.ChatCompletionMessage, opts *domain.Cha
var resp *http.Response
if resp, err = c.HttpClient.Do(req); err != nil {
err = fmt.Errorf("failed to send request: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_send_request"), err)
return
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
err = fmt.Errorf("unexpected status code: %d", resp.StatusCode)
err = fmt.Errorf(i18n.T("lmstudio_unexpected_status_code"), resp.StatusCode)
return
}
@@ -131,7 +132,7 @@ func (c *Client) SendStream(msgs []*chat.ChatCompletionMessage, opts *domain.Cha
err = nil
break
}
err = fmt.Errorf("error reading response: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_error_reading_response"), err)
return
}
@@ -204,13 +205,13 @@ func (c *Client) Send(ctx context.Context, msgs []*chat.ChatCompletionMessage, o
var jsonPayload []byte
if jsonPayload, err = json.Marshal(payload); err != nil {
err = fmt.Errorf("failed to marshal payload: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_marshal_payload"), err)
return
}
var req *http.Request
if req, err = http.NewRequestWithContext(ctx, "POST", url, bytes.NewBuffer(jsonPayload)); err != nil {
err = fmt.Errorf("failed to create request: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_create_request"), err)
return
}
@@ -218,37 +219,37 @@ func (c *Client) Send(ctx context.Context, msgs []*chat.ChatCompletionMessage, o
var resp *http.Response
if resp, err = c.HttpClient.Do(req); err != nil {
err = fmt.Errorf("failed to send request: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_send_request"), err)
return
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
err = fmt.Errorf("unexpected status code: %d", resp.StatusCode)
err = fmt.Errorf(i18n.T("lmstudio_unexpected_status_code"), resp.StatusCode)
return
}
var result map[string]any
if err = json.NewDecoder(resp.Body).Decode(&result); err != nil {
err = fmt.Errorf("failed to decode response: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_decode_response"), err)
return
}
var choices []any
var ok bool
if choices, ok = result["choices"].([]any); !ok || len(choices) == 0 {
err = fmt.Errorf("invalid response format: missing or empty choices")
err = fmt.Errorf("%s", i18n.T("lmstudio_invalid_response_missing_choices"))
return
}
var message map[string]any
if message, ok = choices[0].(map[string]any)["message"].(map[string]any); !ok {
err = fmt.Errorf("invalid response format: missing message in first choice")
err = fmt.Errorf("%s", i18n.T("lmstudio_invalid_response_missing_message"))
return
}
if content, ok = message["content"].(string); !ok {
err = fmt.Errorf("invalid response format: missing or non-string content in message")
err = fmt.Errorf("%s", i18n.T("lmstudio_invalid_response_missing_content"))
return
}
@@ -266,13 +267,13 @@ func (c *Client) Complete(ctx context.Context, prompt string, opts *domain.ChatO
var jsonPayload []byte
if jsonPayload, err = json.Marshal(payload); err != nil {
err = fmt.Errorf("failed to marshal payload: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_marshal_payload"), err)
return
}
var req *http.Request
if req, err = http.NewRequestWithContext(ctx, "POST", url, bytes.NewBuffer(jsonPayload)); err != nil {
err = fmt.Errorf("failed to create request: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_create_request"), err)
return
}
@@ -280,31 +281,31 @@ func (c *Client) Complete(ctx context.Context, prompt string, opts *domain.ChatO
var resp *http.Response
if resp, err = c.HttpClient.Do(req); err != nil {
err = fmt.Errorf("failed to send request: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_send_request"), err)
return
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
err = fmt.Errorf("unexpected status code: %d", resp.StatusCode)
err = fmt.Errorf(i18n.T("lmstudio_unexpected_status_code"), resp.StatusCode)
return
}
var result map[string]any
if err = json.NewDecoder(resp.Body).Decode(&result); err != nil {
err = fmt.Errorf("failed to decode response: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_decode_response"), err)
return
}
var choices []any
var ok bool
if choices, ok = result["choices"].([]any); !ok || len(choices) == 0 {
err = fmt.Errorf("invalid response format: missing or empty choices")
err = fmt.Errorf("%s", i18n.T("lmstudio_invalid_response_missing_choices"))
return
}
if text, ok = choices[0].(map[string]any)["text"].(string); !ok {
err = fmt.Errorf("invalid response format: missing or non-string text in first choice")
err = fmt.Errorf("%s", i18n.T("lmstudio_invalid_response_missing_text"))
return
}
@@ -322,13 +323,13 @@ func (c *Client) GetEmbeddings(ctx context.Context, input string, opts *domain.C
var jsonPayload []byte
if jsonPayload, err = json.Marshal(payload); err != nil {
err = fmt.Errorf("failed to marshal payload: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_marshal_payload"), err)
return
}
var req *http.Request
if req, err = http.NewRequestWithContext(ctx, "POST", url, bytes.NewBuffer(jsonPayload)); err != nil {
err = fmt.Errorf("failed to create request: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_create_request"), err)
return
}
@@ -336,13 +337,13 @@ func (c *Client) GetEmbeddings(ctx context.Context, input string, opts *domain.C
var resp *http.Response
if resp, err = c.HttpClient.Do(req); err != nil {
err = fmt.Errorf("failed to send request: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_send_request"), err)
return
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
err = fmt.Errorf("unexpected status code: %d", resp.StatusCode)
err = fmt.Errorf(i18n.T("lmstudio_unexpected_status_code"), resp.StatusCode)
return
}
@@ -353,12 +354,12 @@ func (c *Client) GetEmbeddings(ctx context.Context, input string, opts *domain.C
}
if err = json.NewDecoder(resp.Body).Decode(&result); err != nil {
err = fmt.Errorf("failed to decode response: %w", err)
err = fmt.Errorf(i18n.T("lmstudio_failed_decode_response"), err)
return
}
if len(result.Data) == 0 {
err = fmt.Errorf("no embeddings returned")
err = fmt.Errorf("%s", i18n.T("lmstudio_no_embeddings_returned"))
return
}