pygpt-net 2.4.44__py3-none-any.whl → 2.4.46__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- CHANGELOG.md +10 -0
- README.md +32 -8
- pygpt_net/CHANGELOG.txt +10 -0
- pygpt_net/__init__.py +2 -2
- pygpt_net/controller/chat/text.py +5 -2
- pygpt_net/controller/idx/__init__.py +2 -1
- pygpt_net/controller/lang/mapping.py +32 -9
- pygpt_net/controller/settings/__init__.py +2 -2
- pygpt_net/core/idx/chat.py +71 -11
- pygpt_net/data/config/config.json +7 -2
- pygpt_net/data/config/models.json +311 -14
- pygpt_net/data/config/modes.json +2 -2
- pygpt_net/data/config/settings.json +104 -11
- pygpt_net/data/config/settings_section.json +3 -0
- pygpt_net/data/css/style.css +1 -0
- pygpt_net/data/locale/locale.de.ini +19 -3
- pygpt_net/data/locale/locale.en.ini +20 -3
- pygpt_net/data/locale/locale.es.ini +19 -3
- pygpt_net/data/locale/locale.fr.ini +19 -3
- pygpt_net/data/locale/locale.it.ini +19 -3
- pygpt_net/data/locale/locale.pl.ini +19 -3
- pygpt_net/data/locale/locale.uk.ini +19 -3
- pygpt_net/data/locale/locale.zh.ini +19 -3
- pygpt_net/data/locale/plugin.cmd_web.de.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.en.ini +5 -5
- pygpt_net/data/locale/plugin.cmd_web.es.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.fr.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.it.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.pl.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.uk.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.zh.ini +1 -1
- pygpt_net/data/locale/plugin.mailer.en.ini +9 -9
- pygpt_net/provider/core/config/patch.py +22 -1
- pygpt_net/provider/core/model/patch.py +156 -1
- pygpt_net/provider/loaders/hub/google/gmail.py +2 -2
- pygpt_net/provider/loaders/web_github_issues.py +13 -0
- pygpt_net/provider/loaders/web_github_repo.py +10 -0
- pygpt_net/provider/loaders/web_google_gmail.py +3 -2
- pygpt_net/provider/loaders/web_rss.py +1 -0
- pygpt_net/provider/loaders/web_sitemap.py +7 -2
- pygpt_net/tools/indexer/ui/web.py +14 -3
- pygpt_net/ui/dialog/settings.py +22 -7
- pygpt_net/ui/widget/dialog/url.py +14 -3
- {pygpt_net-2.4.44.dist-info → pygpt_net-2.4.46.dist-info}/METADATA +33 -9
- {pygpt_net-2.4.44.dist-info → pygpt_net-2.4.46.dist-info}/RECORD +48 -48
- {pygpt_net-2.4.44.dist-info → pygpt_net-2.4.46.dist-info}/LICENSE +0 -0
- {pygpt_net-2.4.44.dist-info → pygpt_net-2.4.46.dist-info}/WHEEL +0 -0
- {pygpt_net-2.4.44.dist-info → pygpt_net-2.4.46.dist-info}/entry_points.txt +0 -0
@@ -102,7 +102,7 @@ assistant.tool.retrieval = 工具:檢索
|
|
102
102
|
assistant.vector_store = 向量存储库
|
103
103
|
attachments.auto_index = 上传时自动索引
|
104
104
|
attachments.btn.add = 添加文件
|
105
|
-
attachments.btn.add_url =
|
105
|
+
attachments.btn.add_url = 网络
|
106
106
|
attachments.btn.clear = 清除文件
|
107
107
|
attachments.capture_clear = 捕獲後清除
|
108
108
|
attachments.clear.confirm = 清除列表?
|
@@ -356,7 +356,7 @@ dialog.start.title = API KEY尚未配置
|
|
356
356
|
dialog.start.title.text = 您的API密鑰尚未配置...\n您將通過在OpenAI網站上註冊賬戶獲得API密鑰:
|
357
357
|
dialog.url.dismiss = 取消
|
358
358
|
dialog.url.tip = 提供您要附加为附加上下文的网页 URL,例如,https://zh.wikipedia.org/wiki/Elon_Musk,或一个要转录的 YouTube 视频,例如,https://www.youtube.com/watch?v=CRRlbK5w8AE。
|
359
|
-
dialog.url.title =
|
359
|
+
dialog.url.title = 添加网络或外部内容作为额外的上下文。
|
360
360
|
dialog.url.update = 添加
|
361
361
|
dialog.workdir.change.confirm = 您确定要更改/移动工作目录到:\n{path}吗?
|
362
362
|
dialog.workdir.change.empty.alert = 目录不为空!操作取消。
|
@@ -852,10 +852,20 @@ settings.agent.llama.steps.desc = 在达到目标前每次迭代的最大步骤
|
|
852
852
|
settings.agent.llama.verbose = 详细(日志输出到控制台)
|
853
853
|
settings.agent.mode = 代理的内部模式
|
854
854
|
settings.agent.mode.desc = 在代理模式下使用的子模式
|
855
|
+
settings.api_azure_endpoint = API 端点
|
856
|
+
settings.api_azure_endpoint.desc = Azure OpenAI API 端点,https://<您的资源名称>.openai.azure.com/
|
857
|
+
settings.api_azure_version = OpenAI API 版本
|
858
|
+
settings.api_azure_version.desc = Azure OpenAI API 版本,例如 2023-07-01-preview
|
855
859
|
settings.api_endpoint = API端点
|
856
860
|
settings.api_endpoint.desc = OpenAI API(或兼容)终端URL,默认为:https://api.openai.com/v1
|
857
861
|
settings.api_key = OpenAI API KEY
|
862
|
+
settings.api_key.anthropic = Anthropic API 密钥
|
863
|
+
settings.api_key.anthropic.desc = Anthropic API 和 Claude 模型所需。
|
858
864
|
settings.api_key.desc = OpenAI API所需。如果您希望使用自定义终端或本地API,则可以在此输入任意值。
|
865
|
+
settings.api_key.google = Google API 密钥
|
866
|
+
settings.api_key.google.desc = Google API 和 Gemini 模型所需。
|
867
|
+
settings.api_key.hugging_face = HuggingFace API 密钥
|
868
|
+
settings.api_key.hugging_face.desc = HuggingFace API 所需。
|
859
869
|
settings.app.env = 应用程序环境 (os.environ)
|
860
870
|
settings.app.env.desc = 在应用程序启动时要设置的额外环境变量
|
861
871
|
settings.audio.input.channels = 声道
|
@@ -977,6 +987,12 @@ settings.render.plain = 在輸出中禁用markdown格式化(RAW純文本模式
|
|
977
987
|
settings.restart.required = 此選項生效需要重新啟動應用程序。
|
978
988
|
settings.section.access = 可访问性
|
979
989
|
settings.section.agent = 代理和专家
|
990
|
+
settings.section.api_keys = API 密钥
|
991
|
+
settings.section.api_keys.anthropic = Anthropic
|
992
|
+
settings.section.api_keys.azure_openai = Azure OpenAI
|
993
|
+
settings.section.api_keys.google = Google
|
994
|
+
settings.section.api_keys.huggingface = HuggingFace
|
995
|
+
settings.section.api_keys.openai = OpenAI
|
980
996
|
settings.section.audio = 音频
|
981
997
|
settings.section.ctx = 上下文
|
982
998
|
settings.section.developer = 開發者
|
@@ -1053,7 +1069,7 @@ tip.input.attachments.uploaded = 這是已上傳到服務器的文件列表,
|
|
1053
1069
|
tip.output.tab.calendar = 使用日曆,您可以導航回特定日期的選定對話。點擊日曆中的一天以限制聊天歷史顯示到該天。您還可以創建日記並為它們分配彩色標籤。
|
1054
1070
|
tip.output.tab.draw = 您可以使用繪圖工具進行快速素描或從相機捕獲圖像,然後將這些圖像發送到AI在視覺模式下進行分析。您可以在這裡使用相機捕獲圖像或從磁盤打開圖像。使用圖像時,它將作為附件包含在發送的消息中。
|
1055
1071
|
tip.output.tab.files = 此工作文件目錄位於您的磁盤上。這裡的文件可供AI訪問。AI可以寫入和讀取文件,也可以從此目錄運行代碼。您可以在本地系統上打開此目錄並放置任何文件。您還可以使用LlamaIndex對這裡的文件進行索引,以便它們作為額外的知識來源。
|
1056
|
-
tip.output.tab.notepad =
|
1072
|
+
tip.output.tab.notepad = 记事本可以用作记笔记和存储信息的工具。您可以在这里保留任何文本,从聊天窗口复制文本,所有信息将自动保存。您可以通过创建新选项卡来创建更多记事本。
|
1057
1073
|
tip.tokens.ctx = 上下文(記憶):使用中 / 全部 - 令牌
|
1058
1074
|
tip.tokens.input = 代币:用户输入提示 + 系统提示 + 上下文 + 额外 + 附件 = 总和 / 最大值
|
1059
1075
|
tip.toolbox.assistants = 助手列表顯示在遠程服務器上創建和運行的助手。任何更改都將與遠程助手同步。
|
@@ -50,8 +50,8 @@ prompt_summarize_url.description = Prompt, der für die Zusammenfassung einer be
|
|
50
50
|
prompt_summarize_url.label = Zusammenfassungs-Prompt (URL öffnen)
|
51
51
|
provider.description = Wählen Sie den Suchmaschinenanbieter, standardmäßig: Google.
|
52
52
|
provider.label = Anbieter
|
53
|
-
raw.label = Verwenden Sie Rohinhalte (ohne Zusammenfassung)
|
54
53
|
raw.description = Ungefilterte Inhalte aus der Websuche zurückgeben, anstatt zusammengefasste Inhalte
|
54
|
+
raw.label = Verwenden Sie Rohinhalte (ohne Zusammenfassung)
|
55
55
|
summary_max_tokens.description = Maximale Tokenanzahl in der Ausgabe beim Generieren einer Zusammenfassung.
|
56
56
|
summary_max_tokens.label = Max. Zusammenfassungs-Tokens
|
57
57
|
summary_model.description = Modell, das für die Zusammenfassung von Webseiten verwendet wird, standardmäßig: gpt-3.5-turbo-1106.
|
@@ -7,10 +7,10 @@ bing_endpoint.description = API endpoint for the Bing Search API, default: https
|
|
7
7
|
bing_endpoint.label = Bing Search API endpoint
|
8
8
|
chunk_size.description = Per-page content chunk size (maximum characters per chunk).
|
9
9
|
chunk_size.label = Per-page content chunk size
|
10
|
-
cmd.web_extract_links.label = Enable: extract_links from webpage
|
11
|
-
cmd.web_extract_links.description = If enabled, model will be able to open URL and get list of all links from it.
|
12
|
-
cmd.web_extract_images.label = Enable: extract_images from webpage
|
13
10
|
cmd.web_extract_images.description = If enabled, model will be able to open URL and get list of all images from it.
|
11
|
+
cmd.web_extract_images.label = Enable: extract_images from webpage
|
12
|
+
cmd.web_extract_links.description = If enabled, model will be able to open URL and get list of all links from it.
|
13
|
+
cmd.web_extract_links.label = Enable: extract_links from webpage
|
14
14
|
cmd.web_index.description = Enable `web_index` command execution.\nIf enabled, the model will be able to index pages and external content using LlamaIndex (persistent index).
|
15
15
|
cmd.web_index.label = Enable: indexing web and external content
|
16
16
|
cmd.web_index_query.description = Enable `web_index_query` command execution.\nIf enabled, the model will be able to quickly index and query web content using LlamaIndex (in-memory index).
|
@@ -41,8 +41,8 @@ idx.description = ID of the index to use for web page indexing (persistent index
|
|
41
41
|
idx.label = Index to use
|
42
42
|
img_thumbnail.description = Enable fetching thumbnails from opened websites.
|
43
43
|
img_thumbnail.label = Show thumbnail images
|
44
|
-
max_open_urls.label = Number of max URLs to open at once
|
45
44
|
max_open_urls.description = Number of max URLs to open at once
|
45
|
+
max_open_urls.label = Number of max URLs to open at once
|
46
46
|
max_page_content_length.description = Maximum characters of page content to retrieve (0 = unlimited).
|
47
47
|
max_page_content_length.label = Max content characters
|
48
48
|
max_result_length.description = Maximum length of the summarized or raw result (characters). (0 = unlimited).
|
@@ -60,8 +60,8 @@ prompt_summarize_url.description = Prompt used for summarizing a specified URL p
|
|
60
60
|
prompt_summarize_url.label = Summarize prompt (URL open)
|
61
61
|
provider.description = Select the search engine provider, default: Google.
|
62
62
|
provider.label = Provider
|
63
|
-
raw.label = Use raw content (without summarization)
|
64
63
|
raw.description = Return raw content from web search instead of summarized content
|
64
|
+
raw.label = Use raw content (without summarization)
|
65
65
|
summary_max_tokens.description = Maximum tokens in output when generating a summary.
|
66
66
|
summary_max_tokens.label = Max summary tokens
|
67
67
|
summary_model.description = Model used for summarizing web pages, default: gpt-3.5-turbo-1106.
|
@@ -50,8 +50,8 @@ prompt_summarize_url.description = Prompt utilizado para resumir una página URL
|
|
50
50
|
prompt_summarize_url.label = Prompt de resumen (apertura de URL)
|
51
51
|
provider.description = Seleccione el proveedor del motor de búsqueda, por defecto: Google.
|
52
52
|
provider.label = Proveedor
|
53
|
-
raw.label = Usar contenido bruto (sin resumir)
|
54
53
|
raw.description = Devolver contenido bruto de la búsqueda en la web en lugar de contenido resumido
|
54
|
+
raw.label = Usar contenido bruto (sin resumir)
|
55
55
|
summary_max_tokens.description = Número máximo de tokens en la salida al generar un resumen.
|
56
56
|
summary_max_tokens.label = Máx tokens de resumen
|
57
57
|
summary_model.description = Modelo utilizado para resumir páginas web, por defecto: gpt-3.5-turbo-1106.
|
@@ -50,8 +50,8 @@ prompt_summarize_url.description = Prompt utilisé pour résumer une page URL sp
|
|
50
50
|
prompt_summarize_url.label = Prompt de résumé (ouverture d'URL)
|
51
51
|
provider.description = Sélectionnez le fournisseur du moteur de recherche, par défaut : Google.
|
52
52
|
provider.label = Fournisseur
|
53
|
-
raw.label = Utiliser le contenu brut (sans résumé)
|
54
53
|
raw.description = Retourner le contenu brut de la recherche sur le web au lieu du contenu résumé
|
54
|
+
raw.label = Utiliser le contenu brut (sans résumé)
|
55
55
|
summary_max_tokens.description = Nombre maximal de tokens dans la sortie lors de la génération d'un résumé.
|
56
56
|
summary_max_tokens.label = Max tokens de résumé
|
57
57
|
summary_model.description = Modèle utilisé pour résumer les pages web, par défaut : gpt-3.5-turbo-1106.
|
@@ -50,8 +50,8 @@ prompt_summarize_url.description = Prompt utilizzato per riassumere una pagina U
|
|
50
50
|
prompt_summarize_url.label = Prompt di riassunto (apertura URL)
|
51
51
|
provider.description = Seleziona il provider del motore di ricerca, predefinito: Google.
|
52
52
|
provider.label = Provider
|
53
|
-
raw.label = Usa contenuto grezzo (senza riassunto)
|
54
53
|
raw.description = Restituisci contenuto grezzo dalla ricerca sul web invece di contenuti riassunti
|
54
|
+
raw.label = Usa contenuto grezzo (senza riassunto)
|
55
55
|
summary_max_tokens.description = Numero massimo di token nell'output durante la generazione di un riassunto.
|
56
56
|
summary_max_tokens.label = Max token di riassunto
|
57
57
|
summary_model.description = Modello utilizzato per riassumere le pagine web, predefinito: gpt-3.5-turbo-1106.
|
@@ -50,8 +50,8 @@ prompt_summarize_url.description = Prompt używany do podsumowywania określonej
|
|
50
50
|
prompt_summarize_url.label = Prompt podsumowujący (otwarte URL)
|
51
51
|
provider.description = Wybierz dostawcę wyszukiwarki, domyślnie: Google.
|
52
52
|
provider.label = Dostawca
|
53
|
-
raw.label = Użyj surowej zawartości (bez podsumowania)
|
54
53
|
raw.description = Zwróć surową zawartość z wyszukiwania w sieci zamiast podsumowanej zawartości
|
54
|
+
raw.label = Użyj surowej zawartości (bez podsumowania)
|
55
55
|
summary_max_tokens.description = Maksymalna liczba tokenów w wyniku przy generowaniu podsumowania.
|
56
56
|
summary_max_tokens.label = Maksymalna liczba tokenów podsumowania
|
57
57
|
summary_model.description = Model używany do podsumowywania stron internetowych, domyślnie: gpt-3.5-turbo-1106.
|
@@ -50,8 +50,8 @@ prompt_summarize_url.description = Шаблон для підсумування
|
|
50
50
|
prompt_summarize_url.label = Шаблон підсумування (відкриття URL)
|
51
51
|
provider.description = Виберіть провайдера пошукової системи, за замовчуванням: Google.
|
52
52
|
provider.label = Провайдер
|
53
|
-
raw.label = Використовувати сирий контент (без узагальнення)
|
54
53
|
raw.description = Повернути сирий контент з пошуку в Інтернеті замість узагальненого контенту
|
54
|
+
raw.label = Використовувати сирий контент (без узагальнення)
|
55
55
|
summary_max_tokens.description = Максимальна кількість токенів у виводі при створенні підсумку.
|
56
56
|
summary_max_tokens.label = Макс. токенів підсумування
|
57
57
|
summary_model.description = Модель, яка використовується для підсумування вебсторінок, за замовчуванням: gpt-3.5-turbo-1106.
|
@@ -50,8 +50,8 @@ prompt_summarize_url.description = 用于总结指定URL页面的提示。
|
|
50
50
|
prompt_summarize_url.label = 总结URL页面的提示
|
51
51
|
provider.description = 选择搜索引擎提供者,默认为Google。
|
52
52
|
provider.label = 提供者
|
53
|
-
raw.label = 使用原始内容(不进行总结)
|
54
53
|
raw.description = 返回来自网络搜索的原始内容,而不是总结的内容
|
54
|
+
raw.label = 使用原始内容(不进行总结)
|
55
55
|
summary_max_tokens.description = 在生成总结时输出的最大代币数。
|
56
56
|
summary_max_tokens.label = 总结的最大代币数
|
57
57
|
summary_model.description = 用于总结网页的模型,默认为:gpt-3.5-turbo-1106。
|
@@ -1,21 +1,21 @@
|
|
1
1
|
[LOCALE]
|
2
|
-
cmd.send_email.label = Enable: send email
|
3
|
-
cmd.send_email.description = Allows for sending emails.
|
4
|
-
cmd.get_emails.label = Enable: receive emails
|
5
|
-
cmd.get_emails.description = Allows for receiving emails.
|
6
|
-
cmd.get_email_body.label = Enable: get email body
|
7
2
|
cmd.get_email_body.description = Allows for receive email body.
|
3
|
+
cmd.get_email_body.label = Enable: get email body
|
4
|
+
cmd.get_emails.description = Allows for receiving emails.
|
5
|
+
cmd.get_emails.label = Enable: receive emails
|
6
|
+
cmd.send_email.description = Allows for sending emails.
|
7
|
+
cmd.send_email.label = Enable: send email
|
8
|
+
from_email.description = From (email), e.g. me@domain.com
|
9
|
+
from_email.label = From (email)
|
8
10
|
plugin.description = Provides the ability to send, receive and read emails from SMTP server.
|
9
11
|
plugin.name = Mailer
|
10
12
|
smtp_host.description = SMTP Host, e.g. smtp.domain.com
|
11
13
|
smtp_host.label = Host
|
14
|
+
smtp_password.description = SMTP Password
|
15
|
+
smtp_password.label = Password
|
12
16
|
smtp_port_inbox.description = SMTP Port (Inbox), default: 995
|
13
17
|
smtp_port_inbox.label = Port (Inbox)
|
14
18
|
smtp_port_outbox.description = SMTP Port (Outbox), default: 465
|
15
19
|
smtp_port_outbox.label = Port (Outbox)
|
16
20
|
smtp_user.description = SMTP User, e.g. user@domain.com
|
17
21
|
smtp_user.label = User
|
18
|
-
smtp_password.description = SMTP Password
|
19
|
-
smtp_password.label = Password
|
20
|
-
from_email.description = From (email), e.g. me@domain.com
|
21
|
-
from_email.label = From (email)
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
7
7
|
# MIT License #
|
8
8
|
# Created By : Marcin Szczygliński #
|
9
|
-
# Updated Date: 2024.12.
|
9
|
+
# Updated Date: 2024.12.16 20:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
import copy
|
@@ -1782,6 +1782,27 @@ class Patch:
|
|
1782
1782
|
data["ctx.records.folders.top"] = True
|
1783
1783
|
updated = True
|
1784
1784
|
|
1785
|
+
# < 2.4.45
|
1786
|
+
if old < parse_version("2.4.45"):
|
1787
|
+
print("Migrating config from < 2.4.45...")
|
1788
|
+
self.window.core.updater.patch_css('style.css', True) # force update
|
1789
|
+
updated = True
|
1790
|
+
|
1791
|
+
# < 2.4.46
|
1792
|
+
if old < parse_version("2.4.46"):
|
1793
|
+
print("Migrating config from < 2.4.46...")
|
1794
|
+
if 'api_azure_version' not in data:
|
1795
|
+
data["api_azure_version"] = "2023-07-01-preview"
|
1796
|
+
if 'api_azure_endpoint' not in data:
|
1797
|
+
data["api_azure_endpoint"] = "https://<your-resource-name>.openai.azure.com/"
|
1798
|
+
if 'api_key_google' not in data:
|
1799
|
+
data["api_key_google"] = ""
|
1800
|
+
if 'api_key_anthropic' not in data:
|
1801
|
+
data["api_key_anthropic"] = ""
|
1802
|
+
if 'api_key_hugging_face' not in data:
|
1803
|
+
data["api_key_hugging_face"] = ""
|
1804
|
+
updated = True
|
1805
|
+
|
1785
1806
|
# update file
|
1786
1807
|
migrated = False
|
1787
1808
|
if updated:
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
7
7
|
# MIT License #
|
8
8
|
# Created By : Marcin Szczygliński #
|
9
|
-
# Updated Date: 2024.
|
9
|
+
# Updated Date: 2024.12.16 20:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
from packaging.version import parse as parse_version, Version
|
@@ -314,6 +314,161 @@ class Patch:
|
|
314
314
|
# add missing gpt-4o-audio-preview, gpt-4o-2024-11-20
|
315
315
|
updated = True
|
316
316
|
|
317
|
+
# < 2.4.46 <--- add separated API keys
|
318
|
+
if old < parse_version("2.4.46"):
|
319
|
+
print("Migrating models from < 2.4.46...")
|
320
|
+
azure_endpoint = ""
|
321
|
+
azure_api_version = ""
|
322
|
+
google_key = ""
|
323
|
+
anthropic_key = ""
|
324
|
+
for id in data:
|
325
|
+
model = data[id]
|
326
|
+
# OpenAI
|
327
|
+
if model.id.startswith("gpt-") or model.id.startswith("o1-"):
|
328
|
+
# langchain
|
329
|
+
is_endpoint = False
|
330
|
+
is_version = False
|
331
|
+
for item in model.langchain["env"]:
|
332
|
+
if item["name"] == "AZURE_OPENAI_ENDPOINT":
|
333
|
+
is_endpoint = True
|
334
|
+
if (item["value"]
|
335
|
+
and item["value"] not in ["{api_azure_endpoint}", "{api_endpoint}"]):
|
336
|
+
azure_endpoint = item["value"]
|
337
|
+
item["value"] = "{api_azure_endpoint}"
|
338
|
+
elif item["name"] == "OPENAI_API_VERSION":
|
339
|
+
is_version = True
|
340
|
+
if (item["value"]
|
341
|
+
and item["value"] not in ["{api_azure_version}"]):
|
342
|
+
azure_api_version = item["value"]
|
343
|
+
item["value"] = "{api_azure_version}"
|
344
|
+
if not is_endpoint:
|
345
|
+
model.langchain["env"].append(
|
346
|
+
{
|
347
|
+
"name": "AZURE_OPENAI_ENDPOINT",
|
348
|
+
"value": "{api_azure_endpoint}",
|
349
|
+
}
|
350
|
+
)
|
351
|
+
if not is_version:
|
352
|
+
model.langchain["env"].append(
|
353
|
+
{
|
354
|
+
"name": "OPENAI_API_VERSION",
|
355
|
+
"value": "{api_azure_version}",
|
356
|
+
}
|
357
|
+
)
|
358
|
+
|
359
|
+
# llama
|
360
|
+
is_endpoint = False
|
361
|
+
is_version = False
|
362
|
+
for item in model.llama_index["env"]:
|
363
|
+
if item["name"] == "AZURE_OPENAI_ENDPOINT":
|
364
|
+
is_endpoint = True
|
365
|
+
if (item["value"]
|
366
|
+
and item["value"] not in ["{api_azure_endpoint}", "{api_endpoint}"]):
|
367
|
+
azure_endpoint = item["value"]
|
368
|
+
item["value"] = "{api_azure_endpoint}"
|
369
|
+
elif item["name"] == "OPENAI_API_VERSION":
|
370
|
+
is_version = True
|
371
|
+
if (item["value"]
|
372
|
+
and item["value"] not in ["{api_azure_version}"]):
|
373
|
+
azure_api_version = item["value"]
|
374
|
+
item["value"] = "{api_azure_version}"
|
375
|
+
if not is_endpoint:
|
376
|
+
model.llama_index["env"].append(
|
377
|
+
{
|
378
|
+
"name": "AZURE_OPENAI_ENDPOINT",
|
379
|
+
"value": "{api_azure_endpoint}",
|
380
|
+
}
|
381
|
+
)
|
382
|
+
if not is_version:
|
383
|
+
model.llama_index["env"].append(
|
384
|
+
{
|
385
|
+
"name": "OPENAI_API_VERSION",
|
386
|
+
"value": "{api_azure_version}",
|
387
|
+
}
|
388
|
+
)
|
389
|
+
|
390
|
+
# Anthropic
|
391
|
+
elif model.id.startswith("claude-"):
|
392
|
+
is_key = False
|
393
|
+
for item in model.langchain["env"]:
|
394
|
+
if item["name"] == "ANTHROPIC_API_KEY":
|
395
|
+
is_key = True
|
396
|
+
if (item["value"]
|
397
|
+
and item["value"] not in ["{api_key}"]):
|
398
|
+
anthropic_key = item["value"]
|
399
|
+
item["value"] = "{api_key_anthropic}"
|
400
|
+
if not is_key:
|
401
|
+
model.langchain["env"].append(
|
402
|
+
{
|
403
|
+
"name": "ANTHROPIC_API_KEY",
|
404
|
+
"value": "{api_key_anthropic}",
|
405
|
+
}
|
406
|
+
)
|
407
|
+
is_key = False
|
408
|
+
for item in model.llama_index["env"]:
|
409
|
+
if item["name"] == "ANTHROPIC_API_KEY":
|
410
|
+
is_key = True
|
411
|
+
if (item["value"]
|
412
|
+
and item["value"] not in ["{api_key}"]):
|
413
|
+
anthropic_key = item["value"]
|
414
|
+
item["value"] = "{api_key_anthropic}"
|
415
|
+
if not is_key:
|
416
|
+
model.llama_index["env"].append(
|
417
|
+
{
|
418
|
+
"name": "ANTHROPIC_API_KEY",
|
419
|
+
"value": "{api_key_anthropic}",
|
420
|
+
}
|
421
|
+
)
|
422
|
+
# Google
|
423
|
+
elif model.id.startswith("gemini-"):
|
424
|
+
is_key = False
|
425
|
+
for item in model.langchain["env"]:
|
426
|
+
if item["name"] == "GOOGLE_API_KEY":
|
427
|
+
is_key = True
|
428
|
+
if (item["value"]
|
429
|
+
and item["value"] not in ["{api_key}"]):
|
430
|
+
google_key = item["value"]
|
431
|
+
item["value"] = "{api_key_google}"
|
432
|
+
if not is_key:
|
433
|
+
model.langchain["env"].append(
|
434
|
+
{
|
435
|
+
"name": "GOOGLE_API_KEY",
|
436
|
+
"value": "{api_key_google}",
|
437
|
+
}
|
438
|
+
)
|
439
|
+
is_key = False
|
440
|
+
for item in model.llama_index["env"]:
|
441
|
+
if item["name"] == "GOOGLE_API_KEY":
|
442
|
+
is_key = True
|
443
|
+
if (item["value"]
|
444
|
+
and item["value"] not in ["{api_key}"]):
|
445
|
+
google_key = item["value"]
|
446
|
+
item["value"] = "{api_key_google}"
|
447
|
+
if not is_key:
|
448
|
+
model.llama_index["env"].append(
|
449
|
+
{
|
450
|
+
"name": "GOOGLE_API_KEY",
|
451
|
+
"value": "{api_key_google}",
|
452
|
+
}
|
453
|
+
)
|
454
|
+
# move API keys to config
|
455
|
+
config_updated = False
|
456
|
+
if azure_endpoint:
|
457
|
+
self.window.core.config.set("api_azure_endpoint", azure_endpoint)
|
458
|
+
config_updated = True
|
459
|
+
if azure_api_version:
|
460
|
+
self.window.core.config.set("api_azure_version", azure_api_version)
|
461
|
+
config_updated = True
|
462
|
+
if google_key:
|
463
|
+
self.window.core.config.set("api_key_google", google_key)
|
464
|
+
config_updated = True
|
465
|
+
if anthropic_key:
|
466
|
+
self.window.core.config.set("api_key_anthropic", anthropic_key)
|
467
|
+
config_updated = True
|
468
|
+
if config_updated:
|
469
|
+
self.window.core.config.save()
|
470
|
+
updated = True
|
471
|
+
|
317
472
|
# update file
|
318
473
|
if updated:
|
319
474
|
data = dict(sorted(data.items()))
|
@@ -21,7 +21,7 @@ class GmailReader(BaseReader, BaseModel):
|
|
21
21
|
Reads emails
|
22
22
|
|
23
23
|
Args:
|
24
|
-
max_results (int): Defaults to 10
|
24
|
+
max_results (int): Defaults to 10.``
|
25
25
|
query (str): Gmail query. Defaults to None.
|
26
26
|
service (Any): Gmail service. Defaults to None.
|
27
27
|
results_per_page (Optional[int]): Max number of results per page. Defaults to 10.
|
@@ -32,7 +32,7 @@ class GmailReader(BaseReader, BaseModel):
|
|
32
32
|
token_path: str = "token.json"
|
33
33
|
use_iterative_parser: bool = False
|
34
34
|
max_results: int = 10
|
35
|
-
service: Any
|
35
|
+
service: Any = None
|
36
36
|
results_per_page: Optional[int]
|
37
37
|
|
38
38
|
def load_data(self, query: str = None) -> List[Document]:
|
@@ -30,19 +30,27 @@ class Loader(BaseLoader):
|
|
30
30
|
"args": {
|
31
31
|
"owner": {
|
32
32
|
"type": "str",
|
33
|
+
"label": "Owner",
|
33
34
|
},
|
34
35
|
"repository": {
|
35
36
|
"type": "str",
|
37
|
+
"label": "Repository",
|
36
38
|
},
|
37
39
|
"state": {
|
38
40
|
"type": "enum",
|
39
41
|
"options": ["open", "closed", "all"],
|
42
|
+
"label": "State",
|
43
|
+
"description": "Issue state, default: open, available options: open, closed, all",
|
40
44
|
},
|
41
45
|
"label_filters_include": {
|
42
46
|
"type": "list",
|
47
|
+
"label": "Label filters include",
|
48
|
+
"description": "List of labels to include, separated by comma (,)",
|
43
49
|
},
|
44
50
|
"label_filters_exclude": {
|
45
51
|
"type": "list",
|
52
|
+
"label": "Label filters exclude",
|
53
|
+
"description": "List of labels to exclude, separated by comma (,)",
|
46
54
|
},
|
47
55
|
},
|
48
56
|
}
|
@@ -98,6 +106,11 @@ class Loader(BaseLoader):
|
|
98
106
|
if "repository" in kwargs and kwargs.get("repository"):
|
99
107
|
if isinstance(kwargs.get("repository"), str):
|
100
108
|
args["repository"] = kwargs.get("repository") # repo name
|
109
|
+
if "state" in kwargs and kwargs.get("state"):
|
110
|
+
if isinstance(kwargs.get("state"), str):
|
111
|
+
args["state"] = kwargs.get("state")
|
112
|
+
if args["state"] not in ["open", "closed", "all"]:
|
113
|
+
args["state"] = "open"
|
101
114
|
|
102
115
|
# filters
|
103
116
|
if "label_filters_include" in kwargs and kwargs.get("label_filters_include"):
|
@@ -30,15 +30,19 @@ class Loader(BaseLoader):
|
|
30
30
|
"args": {
|
31
31
|
"commit_sha": {
|
32
32
|
"type": "str",
|
33
|
+
"label": "Commit SHA",
|
33
34
|
},
|
34
35
|
"branch": {
|
35
36
|
"type": "str",
|
37
|
+
"label": "Branch",
|
36
38
|
},
|
37
39
|
"owner": {
|
38
40
|
"type": "str",
|
41
|
+
"label": "Owner",
|
39
42
|
},
|
40
43
|
"repository": {
|
41
44
|
"type": "str",
|
45
|
+
"label": "Repository",
|
42
46
|
}
|
43
47
|
},
|
44
48
|
},
|
@@ -68,6 +72,12 @@ class Loader(BaseLoader):
|
|
68
72
|
"filter_file_ext_include": "list",
|
69
73
|
"filter_file_ext_exclude": "list",
|
70
74
|
}
|
75
|
+
self.init_args_desc = {
|
76
|
+
"filter_dirs_include": "List of directories to include, separated by comma (,)",
|
77
|
+
"filter_dirs_exclude": "List of directories to exclude, separated by comma (,)",
|
78
|
+
"filter_file_ext_include": "List of file extensions to include, separated by comma (,)",
|
79
|
+
"filter_file_ext_exclude": "list of file extensions to exclude, separated by comma (,)",
|
80
|
+
}
|
71
81
|
|
72
82
|
def get(self) -> BaseReader:
|
73
83
|
"""
|
@@ -31,6 +31,7 @@ class Loader(BaseLoader):
|
|
31
31
|
"query": {
|
32
32
|
"type": "str",
|
33
33
|
"label": "Query",
|
34
|
+
"description": "Query to search emails, e.g. from:me after:2023-01-01",
|
34
35
|
},
|
35
36
|
},
|
36
37
|
}
|
@@ -41,7 +42,7 @@ class Loader(BaseLoader):
|
|
41
42
|
"token_path": "token.json",
|
42
43
|
"use_iterative_parser": False,
|
43
44
|
"max_results": 10,
|
44
|
-
"service": None,
|
45
|
+
# "service": None,
|
45
46
|
"results_per_page": None,
|
46
47
|
}
|
47
48
|
self.init_args_types = {
|
@@ -49,7 +50,7 @@ class Loader(BaseLoader):
|
|
49
50
|
"token_path": "str",
|
50
51
|
"use_iterative_parser": "bool",
|
51
52
|
"max_results": "int",
|
52
|
-
"service": "str",
|
53
|
+
# "service": "str",
|
53
54
|
"results_per_page": "int",
|
54
55
|
}
|
55
56
|
|
@@ -23,12 +23,13 @@ class Loader(BaseLoader):
|
|
23
23
|
self.type = ["web"]
|
24
24
|
self.instructions = [
|
25
25
|
{
|
26
|
-
"
|
27
|
-
"description": "read
|
26
|
+
"sitemap": {
|
27
|
+
"description": "read all web pages from sitemap.xml",
|
28
28
|
"args": {
|
29
29
|
"url": {
|
30
30
|
"type": "str",
|
31
31
|
"label": "URL",
|
32
|
+
"description": "URL to sitemap XML, e.g. https://example.com/sitemap.xml, all pages will be read",
|
32
33
|
},
|
33
34
|
},
|
34
35
|
}
|
@@ -42,6 +43,10 @@ class Loader(BaseLoader):
|
|
42
43
|
"html_to_text": "bool",
|
43
44
|
"limit": "int",
|
44
45
|
}
|
46
|
+
self.init_args_desc = {
|
47
|
+
"html_to_text": "Whether to convert HTML to text",
|
48
|
+
"limit": "Maximum number of concurrent requests",
|
49
|
+
}
|
45
50
|
|
46
51
|
def get(self) -> BaseReader:
|
47
52
|
"""
|
@@ -12,11 +12,12 @@
|
|
12
12
|
import json
|
13
13
|
|
14
14
|
from PySide6.QtCore import Qt
|
15
|
+
from PySide6.QtGui import QIcon
|
15
16
|
from PySide6.QtWidgets import QLabel, QVBoxLayout, QWidget, QCheckBox, QHBoxLayout, QScrollArea, \
|
16
17
|
QSizePolicy
|
17
18
|
|
18
19
|
from pygpt_net.ui.widget.element.group import QVLine, QHLine
|
19
|
-
from pygpt_net.ui.widget.element.labels import HelpLabel, UrlLabel
|
20
|
+
from pygpt_net.ui.widget.element.labels import HelpLabel, UrlLabel, IconLabel
|
20
21
|
from pygpt_net.ui.widget.option.combo import OptionCombo
|
21
22
|
from pygpt_net.ui.widget.option.input import OptionInput
|
22
23
|
from pygpt_net.utils import trans
|
@@ -62,7 +63,18 @@ class WebTab:
|
|
62
63
|
self.window.ui.add_hook("update.tool.indexer.web.loader", self.hook_loader_change)
|
63
64
|
|
64
65
|
self.window.ui.nodes["tool.indexer.web.options.label"] = HelpLabel(trans("tool.indexer.tab.web.source"))
|
65
|
-
|
66
|
+
|
67
|
+
config_label = HelpLabel(trans("tool.indexer.tab.web.cfg"))
|
68
|
+
config_label.setWordWrap(False)
|
69
|
+
|
70
|
+
config_label_layout = QHBoxLayout()
|
71
|
+
config_label_layout.addWidget(IconLabel(QIcon(":/icons/settings_filled.svg")))
|
72
|
+
config_label_layout.addWidget(config_label)
|
73
|
+
config_label_layout.setAlignment(Qt.AlignLeft)
|
74
|
+
|
75
|
+
self.window.ui.nodes["tool.indexer.web.config.label"] = QWidget()
|
76
|
+
self.window.ui.nodes["tool.indexer.web.config.label"].setLayout(config_label_layout)
|
77
|
+
|
66
78
|
self.window.ui.nodes["tool.indexer.web.config.help"] = UrlLabel(
|
67
79
|
trans("tool.indexer.tab.web.help"),
|
68
80
|
"https://pygpt.readthedocs.io/en/latest/configuration.html#data-loaders")
|
@@ -95,7 +107,6 @@ class WebTab:
|
|
95
107
|
|
96
108
|
# config
|
97
109
|
params_layout.addWidget(self.window.ui.nodes["tool.indexer.web.config.label"])
|
98
|
-
self.window.ui.nodes["tool.indexer.web.config.label"].setAlignment(Qt.AlignCenter)
|
99
110
|
inputs, groups = self.window.core.idx.ui.loaders.setup_loader_config()
|
100
111
|
for loader in inputs:
|
101
112
|
for k in inputs[loader]:
|