Skip to content

Commit

Permalink
✨ feat(ollama): improve connection check method and provide selector …
Browse files Browse the repository at this point in the history
…for user to control model options (lobehub#1397)

* 🐛 fix(ollama): change checker with ollama's tags api

* ✨feat(ollama): add error card to pull model

* 🚚 chore: move files

* 💄 style: update llava logo

* 🐛 fix: add ollama service unavailable error type

* 🐛 fix: ollama show passed with error message exists

* ✨ feat(ollama): add download moniter to show speed and eta remaining time

* 🚨 ci: fix lint

* 💄 style: improve download style

* 🌐 style: add i18n

---------

Co-authored-by: shijianyue <[email protected]>
Co-authored-by: arvinxx <[email protected]>
  • Loading branch information
3 people authored Mar 15, 2024
1 parent e472d6e commit 675902f
Show file tree
Hide file tree
Showing 58 changed files with 747 additions and 59 deletions.
8 changes: 8 additions & 0 deletions locales/ar/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"MoonshotBizError": "حدث خطأ في خدمة جانب القمر، يرجى التحقق من المعلومات أدناه أو إعادة المحاولة",
"NoOpenAIAPIKey": "مفتاح API الخاص بـ OpenAI فارغ، يرجى إضافة مفتاح API الخاص بـ OpenAI",
"OllamaBizError": "خطأ في طلب خدمة Ollama، يرجى التحقق من المعلومات التالية أو إعادة المحاولة",
"OllamaServiceUnavailable": "خدمة Ollama غير متوفرة، يرجى التحقق مما إذا كانت قد تم تشغيلها بشكل صحيح",
"OpenAIBizError": "حدث خطأ في طلب خدمة OpenAI، يرجى التحقق من المعلومات أدناه وإعادة المحاولة",
"PerplexityBizError": "خطأ في طلب خدمة Perplexity AI، يرجى التحقق من المعلومات التالية أو إعادة المحاولة",
"PluginApiNotFound": "عذرًا، لا يوجد API للإضافة في وصف الإضافة، يرجى التحقق من تطابق طريقة الطلب الخاصة بك مع API الوصف",
Expand Down Expand Up @@ -114,6 +115,13 @@
},
"closeMessage": "إغلاق الرسالة",
"confirm": "تأكيد وإعادة المحاولة",
"model": {
"Ollama": {
"confirm": "تحميل",
"description": "أدخل علامة نموذج Ollama الخاصة بك لاستكمال الجلسة",
"title": "تحميل نموذج Ollama المحدد"
}
},
"oauth": {
"description": "فتح المسؤول توثيق تسجيل الدخول الموحد، انقر فوق الزر أدناه لتسجيل الدخول وفتح التطبيق",
"success": "تم تسجيل الدخول بنجاح",
Expand Down
10 changes: 9 additions & 1 deletion locales/ar/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@
},
"waitingForMore": "يتم <1>التخطيط لتوفير</1> المزيد من النماذج، ترقبوا المزيد ✨"
},
"ollama": {
"download": {
"desc": "جارٍ تنزيل النموذج، يرجى عدم إغلاق هذه الصفحة. سيتم استئناف التنزيل من حيث توقف في حالة إعادة التنزيل",
"remainingTime": "الوقت المتبقي",
"speed": "سرعة التنزيل",
"title": "جارٍ تنزيل النموذج {{model}}"
}
},
"plugin": {
"addTooltip": "إضافة البرنامج المساعد",
"clearDeprecated": "مسح البرامج المساعدة الغير صالحة",
Expand Down Expand Up @@ -428,4 +436,4 @@
},
"title": "أدوات الامتداد"
}
}
}
8 changes: 8 additions & 0 deletions locales/de-DE/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"MoonshotBizError": "Fehler beim Abrufen des Dark Side of the Moon-Services. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.",
"NoOpenAIAPIKey": "Der OpenAI-API-Schlüssel ist leer. Bitte fügen Sie einen benutzerdefinierten OpenAI-API-Schlüssel hinzu",
"OllamaBizError": "Fehler bei der Anforderung des Ollama-Dienstes. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.",
"OllamaServiceUnavailable": "Ollama-Dienst nicht verfügbar. Bitte überprüfen Sie, ob er ordnungsgemäß gestartet wurde.",
"OpenAIBizError": "Fehler bei der OpenAI-Serviceanfrage. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut",
"PerplexityBizError": "Fehler bei der Anforderung des Perplexity AI-Dienstes. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.",
"PluginApiNotFound": "Entschuldigung, das API des Plugins im Plugin-Manifest existiert nicht. Bitte überprüfen Sie, ob Ihre Anfragemethode mit dem Plugin-Manifest-API übereinstimmt",
Expand Down Expand Up @@ -114,6 +115,13 @@
},
"closeMessage": "Hinweis schließen",
"confirm": "Bestätigen und erneut versuchen",
"model": {
"Ollama": {
"confirm": "Herunterladen",
"description": "Geben Sie Ihre Ollama-Modellbezeichnung ein, um fortzufahren",
"title": "Bestimmtes Ollama-Modell herunterladen"
}
},
"oauth": {
"description": "Der Administrator hat die einheitliche Anmeldeauthentifizierung aktiviert. Klicken Sie unten auf die Schaltfläche, um sich anzumelden und die App zu entsperren.",
"success": "Anmeldung erfolgreich",
Expand Down
10 changes: 9 additions & 1 deletion locales/de-DE/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@
},
"waitingForMore": "Weitere Modelle werden <1>geplant</1>, bitte freuen Sie sich auf weitere Updates ✨"
},
"ollama": {
"download": {
"desc": "Ollama lädt dieses Modell herunter. Bitte schließen Sie diese Seite nicht. Der Download wird an der abgebrochenen Stelle fortgesetzt, wenn Sie ihn erneut starten.",
"remainingTime": "Verbleibende Zeit",
"speed": "Download-Geschwindigkeit",
"title": "Modell {{model}} wird heruntergeladen"
}
},
"plugin": {
"addTooltip": "Benutzerdefiniertes Plugin",
"clearDeprecated": "Entfernen Sie ungültige Plugins",
Expand Down Expand Up @@ -428,4 +436,4 @@
},
"title": "Erweiterungswerkzeuge"
}
}
}
8 changes: 8 additions & 0 deletions locales/en-US/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"MoonshotBizError": "There was an error with the Moonshot service, please troubleshoot or retry based on the following information.",
"NoOpenAIAPIKey": "OpenAI API Key is empty, please add a custom OpenAI API Key",
"OllamaBizError": "Error requesting Ollama service, please troubleshoot or retry based on the following information",
"OllamaServiceUnavailable": "Ollama service not detected, please check if it is running properly",
"OpenAIBizError": "Error requesting OpenAI service. Please troubleshoot or retry based on the following information.",
"PerplexityBizError": "Error requesting Perplexity AI service. Please troubleshoot or retry based on the following information.",
"PluginApiNotFound": "Sorry, the API does not exist in the plugin's manifest. Please check if your request method matches the plugin manifest API",
Expand Down Expand Up @@ -114,6 +115,13 @@
},
"closeMessage": "Close message",
"confirm": "Confirm and Retry",
"model": {
"Ollama": {
"confirm": "Download",
"description": "Enter your Ollama model label to proceed with the conversation",
"title": "Download specified Ollama model"
}
},
"oauth": {
"description": "The administrator has enabled unified login authentication. Click the button below to log in and unlock the application.",
"success": "Login successful",
Expand Down
10 changes: 9 additions & 1 deletion locales/en-US/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@
},
"waitingForMore": "More models are <1>planned to be added</1>, stay tuned ✨"
},
"ollama": {
"download": {
"desc": "Ollama is currently downloading the model. Please try not to close this page. It will resume from where it left off if you restart the download.",
"remainingTime": "Remaining Time",
"speed": "Download Speed",
"title": "Downloading model {{model}}"
}
},
"plugin": {
"addTooltip": "Custom Plugin",
"clearDeprecated": "Remove Deprecated Plugins",
Expand Down Expand Up @@ -428,4 +436,4 @@
},
"title": "Extension Tools"
}
}
}
8 changes: 8 additions & 0 deletions locales/es-ES/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"MoonshotBizError": "Se produjo un error al solicitar el servicio de Moonshot en el lado oscuro de la luna. Por favor, revise la siguiente información o inténtelo de nuevo.",
"NoOpenAIAPIKey": "La clave de API de OpenAI está vacía. Agregue una clave de API de OpenAI personalizada",
"OllamaBizError": "Error al solicitar el servicio de Ollama, por favor verifica la siguiente información o inténtalo de nuevo",
"OllamaServiceUnavailable": "Servicio Ollama no disponible: Ollama no detectado. Por favor, verifica si está iniciado correctamente.",
"OpenAIBizError": "Error al solicitar el servicio OpenAI. Depure o reintente según la siguiente información",
"PerplexityBizError": "Error comercial al solicitar el servicio de IA de Perplexity. Por favor, revisa la siguiente información o inténtalo de nuevo",
"PluginApiNotFound": "Lo sentimos, el API especificado no existe en el manifiesto del complemento. Verifique si su método de solicitud coincide con el API del manifiesto del complemento",
Expand Down Expand Up @@ -114,6 +115,13 @@
},
"closeMessage": "Cerrar mensaje",
"confirm": "Confirmar y volver a intentar",
"model": {
"Ollama": {
"confirm": "Descargar",
"description": "Ingresa las etiquetas de tu modelo Ollama para continuar la sesión",
"title": "Descargar el modelo Ollama especificado"
}
},
"oauth": {
"description": "El administrador ha habilitado la autenticación de inicio de sesión única. Haz clic en el botón a continuación para iniciar sesión y desbloquear la aplicación.",
"success": "Inicio de sesión exitoso",
Expand Down
10 changes: 9 additions & 1 deletion locales/es-ES/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@
},
"waitingForMore": "Más modelos están en <1>planificación para su incorporación</1>, ¡estén atentos! ✨"
},
"ollama": {
"download": {
"desc": "Ollama está descargando este modelo. Por favor, no cierres esta página. La descarga se reanudará desde donde se detuvo si se reinicia.",
"remainingTime": "Tiempo restante",
"speed": "Velocidad de descarga",
"title": "Descargando el modelo {{model}}"
}
},
"plugin": {
"addTooltip": "Agregar complemento personalizado",
"clearDeprecated": "Eliminar complementos obsoletos",
Expand Down Expand Up @@ -428,4 +436,4 @@
},
"title": "Herramientas de extensión"
}
}
}
8 changes: 8 additions & 0 deletions locales/fr-FR/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"MoonshotBizError": "Erreur de service Moonshot : une erreur s'est produite lors de la demande du service Côté Obscur de la Lune. Veuillez vérifier les informations suivantes ou réessayer.",
"NoOpenAIAPIKey": "La clé API OpenAI est vide. Veuillez ajouter une clé API OpenAI personnalisée",
"OllamaBizError": "Erreur commerciale lors de la demande de service Ollama, veuillez vérifier les informations ci-dessous ou réessayer",
"OllamaServiceUnavailable": "Service Ollama non disponible, veuillez vérifier s'il est démarré correctement",
"OpenAIBizError": "Erreur de service OpenAI. Veuillez diagnostiquer ou réessayer en fonction des informations ci-dessous",
"PerplexityBizError": "Erreur commerciale lors de la demande de service Perplexity AI. Veuillez vérifier les informations suivantes ou réessayer.",
"PluginApiNotFound": "Désolé, l'API spécifiée n'existe pas dans le manifeste du plugin. Veuillez vérifier que votre méthode de requête correspond à l'API du manifeste du plugin",
Expand Down Expand Up @@ -114,6 +115,13 @@
},
"closeMessage": "Fermer le message",
"confirm": "Confirmer et réessayer",
"model": {
"Ollama": {
"confirm": "Télécharger",
"description": "Saisissez l'étiquette de votre modèle Ollama pour continuer la session",
"title": "Télécharger le modèle Ollama spécifié"
}
},
"oauth": {
"description": "L'administrateur a activé l'authentification de connexion unique. Cliquez sur le bouton ci-dessous pour vous connecter et déverrouiller l'application.",
"success": "Connexion réussie",
Expand Down
10 changes: 9 additions & 1 deletion locales/fr-FR/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@
},
"waitingForMore": "Plus de modèles sont en cours de <1>planification pour être ajoutés</1>, restez à l'écoute ✨"
},
"ollama": {
"download": {
"desc": "Ollama est en train de télécharger ce modèle. Veuillez ne pas fermer cette page. Le téléchargement reprendra là où il s'est arrêté en cas de reprise.",
"remainingTime": "Temps restant",
"speed": "Vitesse de téléchargement",
"title": "Téléchargement du modèle {{model}} en cours"
}
},
"plugin": {
"addTooltip": "Ajouter un plugin personnalisé",
"clearDeprecated": "Effacer les plugins obsolètes",
Expand Down Expand Up @@ -428,4 +436,4 @@
},
"title": "Outils supplémentaires"
}
}
}
8 changes: 8 additions & 0 deletions locales/it-IT/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"MoonshotBizError": "Si è verificato un errore nel servizio Moonshot, si prega di controllare le informazioni seguenti o riprovare",
"NoOpenAIAPIKey": "La chiave API OpenAI è vuota. Aggiungi una chiave API personalizzata OpenAI",
"OllamaBizError": "Errore di servizio Ollama, controllare le informazioni seguenti o riprovare",
"OllamaServiceUnavailable": "Servizio Ollama non disponibile: controlla se è avviato correttamente",
"OpenAIBizError": "Errore nella richiesta del servizio OpenAI. Segui le informazioni seguenti per individuare e riprovare",
"PerplexityBizError": "Errore di business nella richiesta del servizio Perplexity AI, controlla le informazioni seguenti o riprova",
"PluginApiNotFound": "Spiacenti, l'API specificata non esiste nel manifesto del plugin. Verifica che il metodo di richiesta corrisponda all'API del manifesto del plugin",
Expand Down Expand Up @@ -114,6 +115,13 @@
},
"closeMessage": "Chiudi messaggio",
"confirm": "Conferma e riprova",
"model": {
"Ollama": {
"confirm": "Scarica",
"description": "Inserisci l'etichetta del tuo modello Ollama per continuare la sessione",
"title": "Scarica il modello Ollama specificato"
}
},
"oauth": {
"description": "L'amministratore ha abilitato l'autenticazione di accesso unificata. Fai clic sul pulsante sottostante per accedere e sbloccare l'applicazione.",
"success": "Accesso riuscito",
Expand Down
10 changes: 9 additions & 1 deletion locales/it-IT/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@
},
"waitingForMore": "Altri modelli sono in fase di <1> pianificazione per l'integrazione </1>, resta sintonizzato ✨"
},
"ollama": {
"download": {
"desc": "Ollama sta scaricando questo modello. Si prega di non chiudere questa pagina. Il download verrà ripreso dal punto in cui è stato interrotto in caso di riavvio.",
"remainingTime": "Tempo rimanente",
"speed": "Velocità di download",
"title": "Download del modello {{model}} in corso"
}
},
"plugin": {
"addTooltip": "Aggiungi plugin personalizzato",
"clearDeprecated": "Rimuovi plugin non validi",
Expand Down Expand Up @@ -428,4 +436,4 @@
},
"title": "Strumenti aggiuntivi"
}
}
}
8 changes: 8 additions & 0 deletions locales/ja-JP/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"MoonshotBizError": "月の裏側サービスのリクエストでエラーが発生しました。以下の情報を確認して再試行してください。",
"NoOpenAIAPIKey": "OpenAI APIキーが空です。カスタムOpenAI APIキーを追加してください。",
"OllamaBizError": "Ollamaサービスのリクエストでエラーが発生しました。以下の情報に基づいてトラブルシューティングを行うか、再度お試しください",
"OllamaServiceUnavailable": "Ollamaサービスが利用できません。正常に起動しているかどうかを確認してください",
"OpenAIBizError": "OpenAIサービスのリクエストエラーが発生しました。以下の情報に基づいて問題を解決したり、再試行したりしてください",
"PerplexityBizError": "Perplexity AIサービスのリクエストでエラーが発生しました。以下の情報に基づいてトラブルシューティングするか、再度お試しください",
"PluginApiNotFound": "申し訳ありませんが、プラグインのマニフェストに指定されたAPIが見つかりませんでした。リクエストメソッドとプラグインのマニフェストのAPIが一致しているかどうかを確認してください",
Expand Down Expand Up @@ -114,6 +115,13 @@
},
"closeMessage": "ヒントを閉じる",
"confirm": "確認して再試行",
"model": {
"Ollama": {
"confirm": "ダウンロード",
"description": "Ollamaモデルのラベルを入力して、会話を続行してください",
"title": "指定のOllamaモデルをダウンロード"
}
},
"oauth": {
"description": "管理者が統一ログイン認証を有効にしました。下のボタンをクリックしてログインすると、アプリがロック解除されます。",
"success": "ログインに成功しました",
Expand Down
10 changes: 9 additions & 1 deletion locales/ja-JP/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@
},
"waitingForMore": "さらに多くのモデルが <1>計画されています</1>。お楽しみに ✨"
},
"ollama": {
"download": {
"desc": "Ollama はモデルをダウンロード中です。ページを閉じないようにしてください。再度ダウンロードすると、中断した箇所から再開されます。",
"remainingTime": "残り時間",
"speed": "ダウンロード速度",
"title": "モデル {{model}} をダウンロード中"
}
},
"plugin": {
"addTooltip": "カスタムプラグイン",
"clearDeprecated": "無効なプラグインをクリア",
Expand Down Expand Up @@ -428,4 +436,4 @@
},
"title": "拡張ツール"
}
}
}
8 changes: 8 additions & 0 deletions locales/ko-KR/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"MoonshotBizError": "요청한 문샷 비즈니스에 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도해주세요.",
"NoOpenAIAPIKey": "OpenAI API 키가 비어 있습니다. 사용자 정의 OpenAI API 키를 추가해주세요.",
"OllamaBizError": "Ollama 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도하십시오.",
"OllamaServiceUnavailable": "Ollama 서비스를 찾을 수 없습니다. 정상적으로 시작되었는지 확인하십시오.",
"OpenAIBizError": "OpenAI 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하고 문제를 해결하거나 다시 시도해주세요.",
"PerplexityBizError": "Perplexity AI 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도하십시오.",
"PluginApiNotFound": "죄송합니다. 플러그인 설명서에 해당 API가 없습니다. 요청 메서드와 플러그인 설명서 API가 일치하는지 확인해주세요.",
Expand Down Expand Up @@ -114,6 +115,13 @@
},
"closeMessage": "알림 닫기",
"confirm": "확인 및 다시 시도",
"model": {
"Ollama": {
"confirm": "다운로드",
"description": "Ollama 모델 태그를 입력하여 세션을 계속할 수 있습니다.",
"title": "지정된 Ollama 모델 다운로드"
}
},
"oauth": {
"description": "관리자가 통합 로그인 인증을 활성화했습니다. 아래 버튼을 클릭하여 로그인하면 앱을 잠금 해제할 수 있습니다.",
"success": "로그인 성공",
Expand Down
10 changes: 9 additions & 1 deletion locales/ko-KR/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@
},
"waitingForMore": "<1>계획에 따라 더 많은 모델이 추가될 예정</1>이니 기대해 주세요 ✨"
},
"ollama": {
"download": {
"desc": "Ollama 모델을 다운로드 중입니다. 이 페이지를 닫지 말아주세요. 다시 다운로드하면 중단된 곳부터 계속됩니다.",
"remainingTime": "남은 시간",
"speed": "다운로드 속도",
"title": "{{model}} 모델 다운로드 중"
}
},
"plugin": {
"addTooltip": "플러그인 추가",
"clearDeprecated": "사용되지 않는 플러그인 제거",
Expand Down Expand Up @@ -428,4 +436,4 @@
},
"title": "확장 도구"
}
}
}
Loading

0 comments on commit 675902f

Please sign in to comment.