pygpt-net 2.4.28__py3-none-any.whl → 2.4.34__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.
Files changed (168) hide show
  1. CHANGELOG.md +40 -0
  2. README.md +62 -5
  3. pygpt_net/CHANGELOG.txt +40 -0
  4. pygpt_net/__init__.py +3 -3
  5. pygpt_net/controller/access/__init__.py +5 -5
  6. pygpt_net/controller/access/control.py +3 -2
  7. pygpt_net/controller/attachment.py +67 -1
  8. pygpt_net/controller/audio/__init__.py +34 -6
  9. pygpt_net/controller/chat/__init__.py +3 -1
  10. pygpt_net/controller/chat/attachment.py +239 -37
  11. pygpt_net/controller/chat/audio.py +99 -0
  12. pygpt_net/controller/chat/input.py +10 -3
  13. pygpt_net/controller/chat/output.py +4 -1
  14. pygpt_net/controller/chat/text.py +10 -5
  15. pygpt_net/controller/dialogs/confirm.py +17 -1
  16. pygpt_net/controller/kernel/reply.py +5 -8
  17. pygpt_net/controller/lang/custom.py +3 -1
  18. pygpt_net/controller/mode.py +2 -1
  19. pygpt_net/controller/presets/editor.py +11 -2
  20. pygpt_net/core/access/voice.py +2 -2
  21. pygpt_net/core/agents/legacy.py +3 -1
  22. pygpt_net/core/attachments/__init__.py +11 -7
  23. pygpt_net/core/attachments/context.py +226 -44
  24. pygpt_net/core/{audio.py → audio/__init__.py} +1 -1
  25. pygpt_net/core/audio/context.py +34 -0
  26. pygpt_net/core/bridge/context.py +29 -1
  27. pygpt_net/core/bridge/worker.py +16 -1
  28. pygpt_net/core/ctx/__init__.py +4 -1
  29. pygpt_net/core/db/__init__.py +4 -2
  30. pygpt_net/core/debug/attachments.py +3 -1
  31. pygpt_net/core/debug/context.py +5 -1
  32. pygpt_net/core/debug/presets.py +3 -1
  33. pygpt_net/core/docker/__init__.py +170 -16
  34. pygpt_net/core/docker/builder.py +6 -2
  35. pygpt_net/core/events/event.py +3 -1
  36. pygpt_net/core/experts/__init__.py +24 -6
  37. pygpt_net/core/idx/chat.py +55 -4
  38. pygpt_net/core/idx/indexing.py +123 -15
  39. pygpt_net/core/modes.py +3 -1
  40. pygpt_net/core/presets.py +13 -2
  41. pygpt_net/core/render/markdown/pid.py +2 -1
  42. pygpt_net/core/render/plain/pid.py +2 -1
  43. pygpt_net/core/render/web/body.py +34 -12
  44. pygpt_net/core/render/web/pid.py +2 -1
  45. pygpt_net/core/render/web/renderer.py +12 -3
  46. pygpt_net/core/tokens.py +4 -2
  47. pygpt_net/core/types/mode.py +2 -1
  48. pygpt_net/data/config/config.json +7 -4
  49. pygpt_net/data/config/models.json +191 -6
  50. pygpt_net/data/config/modes.json +11 -5
  51. pygpt_net/data/config/presets/current.audio.json +34 -0
  52. pygpt_net/data/config/settings.json +15 -1
  53. pygpt_net/data/css/web.css +70 -0
  54. pygpt_net/data/css/web.dark.css +4 -1
  55. pygpt_net/data/css/web.light.css +1 -1
  56. pygpt_net/data/locale/locale.de.ini +33 -20
  57. pygpt_net/data/locale/locale.en.ini +73 -58
  58. pygpt_net/data/locale/locale.es.ini +33 -20
  59. pygpt_net/data/locale/locale.fr.ini +35 -22
  60. pygpt_net/data/locale/locale.it.ini +33 -20
  61. pygpt_net/data/locale/locale.pl.ini +36 -23
  62. pygpt_net/data/locale/locale.uk.ini +33 -20
  63. pygpt_net/data/locale/locale.zh.ini +40 -27
  64. pygpt_net/data/locale/plugin.cmd_code_interpreter.de.ini +6 -0
  65. pygpt_net/data/locale/plugin.cmd_code_interpreter.en.ini +15 -7
  66. pygpt_net/data/locale/plugin.cmd_code_interpreter.es.ini +6 -0
  67. pygpt_net/data/locale/plugin.cmd_code_interpreter.fr.ini +6 -0
  68. pygpt_net/data/locale/plugin.cmd_code_interpreter.it.ini +6 -0
  69. pygpt_net/data/locale/plugin.cmd_code_interpreter.pl.ini +6 -0
  70. pygpt_net/data/locale/plugin.cmd_code_interpreter.uk.ini +6 -0
  71. pygpt_net/data/locale/plugin.cmd_code_interpreter.zh.ini +6 -0
  72. pygpt_net/data/locale/plugin.cmd_files.de.ini +4 -4
  73. pygpt_net/data/locale/plugin.cmd_files.en.ini +4 -4
  74. pygpt_net/data/locale/plugin.cmd_files.es.ini +4 -4
  75. pygpt_net/data/locale/plugin.cmd_files.fr.ini +4 -4
  76. pygpt_net/data/locale/plugin.cmd_files.it.ini +4 -4
  77. pygpt_net/data/locale/plugin.cmd_files.pl.ini +4 -4
  78. pygpt_net/data/locale/plugin.cmd_files.uk.ini +4 -4
  79. pygpt_net/data/locale/plugin.cmd_files.zh.ini +4 -4
  80. pygpt_net/data/locale/plugin.cmd_system.de.ini +6 -6
  81. pygpt_net/data/locale/plugin.cmd_system.en.ini +12 -6
  82. pygpt_net/data/locale/plugin.cmd_system.es.ini +6 -6
  83. pygpt_net/data/locale/plugin.cmd_system.fr.ini +6 -6
  84. pygpt_net/data/locale/plugin.cmd_system.it.ini +6 -6
  85. pygpt_net/data/locale/plugin.cmd_system.pl.ini +6 -6
  86. pygpt_net/data/locale/plugin.cmd_system.uk.ini +6 -6
  87. pygpt_net/data/locale/plugin.cmd_system.zh.ini +6 -6
  88. pygpt_net/data/locale/plugin.cmd_web.de.ini +5 -5
  89. pygpt_net/data/locale/plugin.cmd_web.en.ini +5 -5
  90. pygpt_net/data/locale/plugin.cmd_web.es.ini +5 -5
  91. pygpt_net/data/locale/plugin.cmd_web.fr.ini +5 -5
  92. pygpt_net/data/locale/plugin.cmd_web.it.ini +5 -5
  93. pygpt_net/data/locale/plugin.cmd_web.pl.ini +5 -5
  94. pygpt_net/data/locale/plugin.cmd_web.uk.ini +5 -5
  95. pygpt_net/data/locale/plugin.cmd_web.zh.ini +5 -5
  96. pygpt_net/data/locale/plugin.idx_llama_index.de.ini +12 -12
  97. pygpt_net/data/locale/plugin.idx_llama_index.en.ini +12 -12
  98. pygpt_net/data/locale/plugin.idx_llama_index.es.ini +12 -12
  99. pygpt_net/data/locale/plugin.idx_llama_index.fr.ini +12 -12
  100. pygpt_net/data/locale/plugin.idx_llama_index.it.ini +12 -12
  101. pygpt_net/data/locale/plugin.idx_llama_index.pl.ini +12 -12
  102. pygpt_net/data/locale/plugin.idx_llama_index.uk.ini +12 -12
  103. pygpt_net/data/locale/plugin.idx_llama_index.zh.ini +12 -12
  104. pygpt_net/item/attachment.py +9 -1
  105. pygpt_net/item/ctx.py +9 -1
  106. pygpt_net/item/preset.py +5 -1
  107. pygpt_net/launcher.py +3 -1
  108. pygpt_net/migrations/Version20241126170000.py +28 -0
  109. pygpt_net/migrations/__init__.py +3 -1
  110. pygpt_net/plugin/audio_input/__init__.py +11 -1
  111. pygpt_net/plugin/audio_input/worker.py +9 -1
  112. pygpt_net/plugin/audio_output/__init__.py +37 -7
  113. pygpt_net/plugin/audio_output/worker.py +38 -41
  114. pygpt_net/plugin/cmd_code_interpreter/__init__.py +51 -35
  115. pygpt_net/plugin/cmd_code_interpreter/builder.py +16 -4
  116. pygpt_net/plugin/cmd_code_interpreter/config.py +98 -39
  117. pygpt_net/plugin/cmd_code_interpreter/docker.py +4 -0
  118. pygpt_net/plugin/cmd_code_interpreter/ipython/__init__.py +13 -0
  119. pygpt_net/plugin/cmd_code_interpreter/{ipython.py → ipython/docker_kernel.py} +10 -3
  120. pygpt_net/plugin/cmd_code_interpreter/ipython/local_kernel.py +220 -0
  121. pygpt_net/plugin/cmd_code_interpreter/runner.py +5 -5
  122. pygpt_net/plugin/cmd_mouse_control/__init__.py +4 -2
  123. pygpt_net/plugin/cmd_system/config.py +50 -0
  124. pygpt_net/plugin/cmd_system/docker.py +4 -0
  125. pygpt_net/plugin/idx_llama_index/__init__.py +23 -1
  126. pygpt_net/plugin/idx_llama_index/worker.py +10 -0
  127. pygpt_net/plugin/openai_dalle/__init__.py +3 -1
  128. pygpt_net/plugin/openai_vision/__init__.py +3 -1
  129. pygpt_net/provider/core/attachment/json_file.py +4 -1
  130. pygpt_net/provider/core/config/patch.py +25 -0
  131. pygpt_net/provider/core/ctx/db_sqlite/storage.py +14 -4
  132. pygpt_net/provider/core/ctx/db_sqlite/utils.py +19 -2
  133. pygpt_net/provider/core/model/patch.py +7 -1
  134. pygpt_net/provider/core/preset/json_file.py +5 -1
  135. pygpt_net/provider/gpt/__init__.py +14 -2
  136. pygpt_net/provider/gpt/audio.py +63 -0
  137. pygpt_net/provider/gpt/chat.py +76 -44
  138. pygpt_net/provider/gpt/utils.py +27 -0
  139. pygpt_net/provider/gpt/vision.py +37 -15
  140. pygpt_net/provider/loaders/base.py +10 -1
  141. pygpt_net/provider/loaders/web_yt.py +19 -1
  142. pygpt_net/tools/code_interpreter/__init__.py +1 -0
  143. pygpt_net/tools/image_viewer/ui/dialogs.py +3 -1
  144. pygpt_net/ui/dialog/preset.py +3 -1
  145. pygpt_net/ui/dialog/url.py +29 -0
  146. pygpt_net/ui/dialogs.py +5 -1
  147. pygpt_net/ui/layout/chat/attachments.py +42 -6
  148. pygpt_net/ui/layout/chat/attachments_ctx.py +14 -4
  149. pygpt_net/ui/layout/chat/attachments_uploaded.py +8 -4
  150. pygpt_net/ui/layout/toolbox/agent.py +8 -7
  151. pygpt_net/ui/layout/toolbox/agent_llama.py +5 -4
  152. pygpt_net/ui/layout/toolbox/prompt.py +8 -6
  153. pygpt_net/ui/menu/tools.py +17 -11
  154. pygpt_net/ui/widget/anims/toggles.py +167 -0
  155. pygpt_net/ui/widget/dialog/url.py +59 -0
  156. pygpt_net/ui/widget/element/group.py +2 -1
  157. pygpt_net/ui/widget/lists/attachment.py +22 -17
  158. pygpt_net/ui/widget/lists/attachment_ctx.py +65 -3
  159. pygpt_net/ui/widget/option/checkbox.py +69 -5
  160. pygpt_net/ui/widget/option/cmd.py +4 -5
  161. pygpt_net/ui/widget/option/toggle.py +62 -0
  162. pygpt_net/ui/widget/option/toggle_label.py +79 -0
  163. pygpt_net/ui/widget/textarea/url.py +43 -0
  164. {pygpt_net-2.4.28.dist-info → pygpt_net-2.4.34.dist-info}/METADATA +65 -7
  165. {pygpt_net-2.4.28.dist-info → pygpt_net-2.4.34.dist-info}/RECORD +168 -154
  166. {pygpt_net-2.4.28.dist-info → pygpt_net-2.4.34.dist-info}/LICENSE +0 -0
  167. {pygpt_net-2.4.28.dist-info → pygpt_net-2.4.34.dist-info}/WHEEL +0 -0
  168. {pygpt_net-2.4.28.dist-info → pygpt_net-2.4.34.dist-info}/entry_points.txt +0 -0
@@ -1,15 +1,15 @@
1
1
  [LOCALE]
2
- auto_index.description = 如果启用,模型使用的每个URL都将自动使用Llama-index(持久索引)进行索引。
3
- auto_index.label = 使用Llama-index自动索引所有使用的URL
2
+ auto_index.description = 如果启用,模型使用的每个URL都将自动使用LlamaIndex(持久索引)进行索引。
3
+ auto_index.label = 使用LlamaIndex自动索引所有使用的URL
4
4
  bing_api_key.description = 您可以在 https://www.microsoft.com/en-us/bing/apis/bing-web-search-api 获得您自己的API密钥。
5
5
  bing_api_key.label = 微软必应搜索API密钥
6
6
  bing_endpoint.description = 必应搜索API的API端点,默认为:https://api.bing.microsoft.com/v7.0/search
7
7
  bing_endpoint.label = 必应搜索API端点
8
8
  chunk_size.description = 每页内容块的大小(每块的最大字符数)。
9
9
  chunk_size.label = 每页内容块的大小
10
- cmd.web_index.description = 启用 web_index 命令执行。\n如果启用,模型将能够使用Llama-index(持久索引)索引页面和外部内容。
10
+ cmd.web_index.description = 启用 web_index 命令执行。\n如果启用,模型将能够使用LlamaIndex(持久索引)索引页面和外部内容。
11
11
  cmd.web_index.label = 启用:索引网络和外部内容
12
- cmd.web_index_query.description = 启用 web_index_query 命令执行。\n如果启用,模型将能够使用Llama-index(内存索引)快速索引和查询网络内容。
12
+ cmd.web_index_query.description = 启用 web_index_query 命令执行。\n如果启用,模型将能够使用LlamaIndex(内存索引)快速索引和查询网络内容。
13
13
  cmd.web_index_query.label = 启用:快速查询网络和外部内容
14
14
  cmd.web_index_query.tooltip = 示例提示:查询网站 http://example.com 关于(问题)。
15
15
  cmd.web_index.tooltip = 示例提示:索引网站 http://example.com。
@@ -42,7 +42,7 @@ model_tmp_query.label = 查询内存索引的模型
42
42
  model_tmp_query.tooltip = 使用于 web_index_query 命令查询临时索引的模型(内存索引)
43
43
  num_pages.description = 每次查询最多搜索的页面数量。
44
44
  num_pages.label = 搜索的页面数量
45
- plugin.description = 提供连接网络、搜索最新数据的网页以及使用Llama-index数据加载工具索引外部内容的能力。
45
+ plugin.description = 提供连接网络、搜索最新数据的网页以及使用LlamaIndex数据加载工具索引外部内容的能力。
46
46
  plugin.name = Web搜索
47
47
  prompt_summarize.description = 用于总结网络搜索结果的提示,使用 {query} 作为搜索查询的占位符。
48
48
  prompt_summarize.label = 总结提示
@@ -1,23 +1,23 @@
1
1
  [LOCALE]
2
- append_meta.description = Wenn aktiviert, werden Metadaten von Llama-index dem zusätzlichen Kontext angehängt
2
+ append_meta.description = Wenn aktiviert, werden Metadaten von LlamaIndex dem zusätzlichen Kontext angehängt
3
3
  append_meta.label = Metadaten zum Kontext hinzufügen
4
- ask_llama_first.description = Wenn aktiviert, wird Llama-index zuerst gefragt und die Antwort als zusätzliches Wissen im prompt verwendet. Wenn deaktiviert, wird Llama-index nur bei Bedarf gefragt. INFO: Deaktiviert im autonomen Modus (über Plugin)!
5
- ask_llama_first.label = Llama-index zuerst fragen
4
+ ask_llama_first.description = Wenn aktiviert, wird LlamaIndex zuerst gefragt und die Antwort als zusätzliches Wissen im prompt verwendet. Wenn deaktiviert, wird LlamaIndex nur bei Bedarf gefragt. INFO: Deaktiviert im autonomen Modus (über Plugin)!
5
+ ask_llama_first.label = LlamaIndex zuerst fragen
6
6
  idx.description = IDs der zu verwendenden Indexe, Standard: base, durch Kommas trennen, wenn mehr als ein Index gleichzeitig verwendet werden soll.
7
7
  idx.label = Zu verwendende Indexe
8
- max_question_chars.description = Maximale Zeichenanzahl in einer Frage beim Abfragen von Llama-index, 0 = keine Begrenzung.
8
+ max_question_chars.description = Maximale Zeichenanzahl in einer Frage beim Abfragen von LlamaIndex, 0 = keine Begrenzung.
9
9
  max_question_chars.label = Maximale Zeichenanzahl in Frage
10
- model_prepare_question.description = Modell zur Vorbereitung einer Frage, bevor Llama-index gefragt wird, Standard: gpt-3.5-turbo
10
+ model_prepare_question.description = Modell zur Vorbereitung einer Frage, bevor LlamaIndex gefragt wird, Standard: gpt-3.5-turbo
11
11
  model_prepare_question.label = Modell zur Fragenvorbereitung
12
- model_query.description = Modell für das Abfragen von Llama-index, Standard: gpt-3.5-turbo.
12
+ model_query.description = Modell für das Abfragen von LlamaIndex, Standard: gpt-3.5-turbo.
13
13
  model_query.label = Modell
14
- plugin.description = Integriert Llama-index (Chat mit Dateien) Speicherung in jedem Chat und stellt zusätzliches Wissen in den Kontext (aus Dateien und aus der Kontexthistorie in der Datenbank)
15
- plugin.name = Chat mit Dateien (Llama-index, inline)
16
- prepare_question.description = Wenn aktiviert, wird die Frage vor dem Stellen an Llama-index vorbereitet, um die beste Anfrage zu erstellen.
17
- prepare_question.label = Frage automatisch vorbereiten, bevor Llama-index zuerst gefragt wird
18
- prepare_question_max_tokens.description = Maximale Tokenanzahl in der Ausgabe beim Vorbereiten einer Frage bevor Llama-index gefragt wird.
14
+ plugin.description = Integriert LlamaIndex (Chat mit Dateien) Speicherung in jedem Chat und stellt zusätzliches Wissen in den Kontext (aus Dateien und aus der Kontexthistorie in der Datenbank)
15
+ plugin.name = Chat mit Dateien (LlamaIndex, inline)
16
+ prepare_question.description = Wenn aktiviert, wird die Frage vor dem Stellen an LlamaIndex vorbereitet, um die beste Anfrage zu erstellen.
17
+ prepare_question.label = Frage automatisch vorbereiten, bevor LlamaIndex zuerst gefragt wird
18
+ prepare_question_max_tokens.description = Maximale Tokenanzahl in der Ausgabe beim Vorbereiten einer Frage bevor LlamaIndex gefragt wird.
19
19
  prepare_question_max_tokens.label = Maximale Ausgabetokenanzahl für die Fragenvorbereitung
20
- prompt.description = Prompt, der verwendet wird, um zu instruieren, wie zusätzliche Daten von Llama-index genutzt werden sollen.
20
+ prompt.description = Prompt, der verwendet wird, um zu instruieren, wie zusätzliche Daten von LlamaIndex genutzt werden sollen.
21
21
  prompt.label = Prompt
22
22
  syntax_prepare_question.description = System-prompt für die Fragenvorbereitung.
23
23
  syntax_prepare_question.label = Prompt für die Fragenvorbereitung
@@ -1,23 +1,23 @@
1
1
  [LOCALE]
2
- append_meta.description = If enabled, metadata from Llama-index will be appended to the additional context
2
+ append_meta.description = If enabled, metadata from LlamaIndex will be appended to the additional context
3
3
  append_meta.label = Append metadata to context
4
- ask_llama_first.description = When enabled, Llama-index will be asked first, and the response will be used as additional knowledge in the prompt. When disabled, Llama-index will be asked only when needed. INFO: Disabled in autonomous mode (via plugin)!
5
- ask_llama_first.label = Ask Llama-index first
4
+ ask_llama_first.description = When enabled, LlamaIndex will be asked first, and the response will be used as additional knowledge in the prompt. When disabled, LlamaIndex will be asked only when needed. INFO: Disabled in autonomous mode (via plugin)!
5
+ ask_llama_first.label = Ask LlamaIndex first
6
6
  idx.description = IDs of indexes to use, default: base, separate by comma if you want to use more than one index at once.
7
7
  idx.label = Indexes to use
8
- max_question_chars.description = Maximum characters in a question when querying Llama-index, 0 = no limit.
8
+ max_question_chars.description = Maximum characters in a question when querying LlamaIndex, 0 = no limit.
9
9
  max_question_chars.label = Maximum characters in question
10
- model_prepare_question.description = Model used to prepare a question before asking Llama-index, default: gpt-3.5-turbo
10
+ model_prepare_question.description = Model used to prepare a question before asking LlamaIndex, default: gpt-3.5-turbo
11
11
  model_prepare_question.label = Model for question preparation
12
- model_query.description = Model used for querying Llama-index, default: gpt-3.5-turbo.
12
+ model_query.description = Model used for querying LlamaIndex, default: gpt-3.5-turbo.
13
13
  model_query.label = Model
14
- plugin.description = Integrates Llama-index (Chat with files) storage in any chat and provides additional knowledge into context (from files and from context history in the database)
15
- plugin.name = Chat with files (Llama-index, inline)
16
- prepare_question.description = When enabled, the question will be prepared before asking Llama-index to create the best query.
17
- prepare_question.label = Auto-prepare question before asking Llama-index first
18
- prepare_question_max_tokens.description = Maximum tokens in output when preparing a question before asking Llama-index.
14
+ plugin.description = Integrates LlamaIndex (Chat with files) storage in any chat and provides additional knowledge into context (from files and from context history in the database)
15
+ plugin.name = Chat with files (LlamaIndex, inline)
16
+ prepare_question.description = When enabled, the question will be prepared before asking LlamaIndex to create the best query.
17
+ prepare_question.label = Auto-prepare question before asking LlamaIndex first
18
+ prepare_question_max_tokens.description = Maximum tokens in output when preparing a question before asking LlamaIndex.
19
19
  prepare_question_max_tokens.label = Maximum output tokens for question preparation
20
- prompt.description = Prompt used to instruct how to use additional data provided from Llama-index.
20
+ prompt.description = Prompt used to instruct how to use additional data provided from LlamaIndex.
21
21
  prompt.label = Prompt
22
22
  syntax_prepare_question.description = System prompt for question preparation.
23
23
  syntax_prepare_question.label = Prompt for question preparation
@@ -1,23 +1,23 @@
1
1
  [LOCALE]
2
- append_meta.description = Si está habilitado, los metadatos de Llama-index se adjuntarán al contexto adicional
2
+ append_meta.description = Si está habilitado, los metadatos de LlamaIndex se adjuntarán al contexto adicional
3
3
  append_meta.label = Anexar metadatos al contexto
4
- ask_llama_first.description = Cuando está habilitado, se consultará primero a Llama-index, y la respuesta se usará como conocimiento adicional en el prompt. Cuando está deshabilitado, Llama-index sólo se consultará cuando sea necesario. INFO: Deshabilitado en modo autónomo (mediante plugin)!
5
- ask_llama_first.label = Consultar primero a Llama-index
4
+ ask_llama_first.description = Cuando está habilitado, se consultará primero a LlamaIndex, y la respuesta se usará como conocimiento adicional en el prompt. Cuando está deshabilitado, LlamaIndex sólo se consultará cuando sea necesario. INFO: Deshabilitado en modo autónomo (mediante plugin)!
5
+ ask_llama_first.label = Consultar primero a LlamaIndex
6
6
  idx.description = ID de los índices a utilizar, por defecto: base, separados por coma si quieres utilizar más de un índice a la vez.
7
7
  idx.label = Índices a utilizar
8
- max_question_chars.description = Máximo de caracteres en una pregunta al consultar Llama-index, 0 = sin límite.
8
+ max_question_chars.description = Máximo de caracteres en una pregunta al consultar LlamaIndex, 0 = sin límite.
9
9
  max_question_chars.label = Máximo de caracteres en pregunta
10
- model_prepare_question.description = Modelo utilizado para preparar una pregunta antes de consultar Llama-index, por defecto: gpt-3.5-turbo
10
+ model_prepare_question.description = Modelo utilizado para preparar una pregunta antes de consultar LlamaIndex, por defecto: gpt-3.5-turbo
11
11
  model_prepare_question.label = Modelo para la preparación de la pregunta
12
- model_query.description = Modelo utilizado para consultar Llama-index, por defecto: gpt-3.5-turbo.
12
+ model_query.description = Modelo utilizado para consultar LlamaIndex, por defecto: gpt-3.5-turbo.
13
13
  model_query.label = Modelo
14
- plugin.description = Integra el almacenamiento de Llama-index (Chat con archivos) en cualquier chat y proporciona conocimiento adicional al contexto (de archivos y del historial de contexto en la base de datos)
15
- plugin.name = Chat con archivos (Llama-index, en línea)
16
- prepare_question.description = Cuando está habilitado, la pregunta se preparará antes de consultar a Llama-index para crear la mejor consulta.
17
- prepare_question.label = Preparar automáticamente la pregunta antes de consultar primero a Llama-index
18
- prepare_question_max_tokens.description = Máxima cantidad de tokens en la salida al preparar una pregunta antes de consultar a Llama-index.
14
+ plugin.description = Integra el almacenamiento de LlamaIndex (Chat con archivos) en cualquier chat y proporciona conocimiento adicional al contexto (de archivos y del historial de contexto en la base de datos)
15
+ plugin.name = Chat con archivos (LlamaIndex, en línea)
16
+ prepare_question.description = Cuando está habilitado, la pregunta se preparará antes de consultar a LlamaIndex para crear la mejor consulta.
17
+ prepare_question.label = Preparar automáticamente la pregunta antes de consultar primero a LlamaIndex
18
+ prepare_question_max_tokens.description = Máxima cantidad de tokens en la salida al preparar una pregunta antes de consultar a LlamaIndex.
19
19
  prepare_question_max_tokens.label = Máxima cantidad de tokens de salida para la preparación de la pregunta
20
- prompt.description = Prompt utilizado para instruir cómo usar datos adicionales proporcionados por Llama-index.
20
+ prompt.description = Prompt utilizado para instruir cómo usar datos adicionales proporcionados por LlamaIndex.
21
21
  prompt.label = Prompt
22
22
  syntax_prepare_question.description = Prompt del sistema para la preparación de la pregunta.
23
23
  syntax_prepare_question.label = Prompt para la preparación de la pregunta
@@ -1,23 +1,23 @@
1
1
  [LOCALE]
2
- append_meta.description = Si activé, les métadonnées de Llama-index seront ajoutées au contexte supplémentaire
2
+ append_meta.description = Si activé, les métadonnées de LlamaIndex seront ajoutées au contexte supplémentaire
3
3
  append_meta.label = Ajouter des métadonnées au contexte
4
- ask_llama_first.description = Lorsqu'activé, Llama-index sera interrogé en premier, et la réponse sera utilisée comme connaissance supplémentaire dans le prompt. Lorsqu'il est désactivé, Llama-index sera demandé seulement si nécessaire. INFO: Désactivé en mode autonome (via plugin)!
5
- ask_llama_first.label = Demander d'abord à Llama-index
4
+ ask_llama_first.description = Lorsqu'activé, LlamaIndex sera interrogé en premier, et la réponse sera utilisée comme connaissance supplémentaire dans le prompt. Lorsqu'il est désactivé, LlamaIndex sera demandé seulement si nécessaire. INFO: Désactivé en mode autonome (via plugin)!
5
+ ask_llama_first.label = Demander d'abord à LlamaIndex
6
6
  idx.description = IDs des index à utiliser, par défaut : base, séparés par une virgule si vous souhaitez utiliser plus d'un index à la fois.
7
7
  idx.label = Index à utiliser
8
- max_question_chars.description = Nombre maximum de caractères dans une question lors de l'interrogation de Llama-index, 0 = pas de limite.
8
+ max_question_chars.description = Nombre maximum de caractères dans une question lors de l'interrogation de LlamaIndex, 0 = pas de limite.
9
9
  max_question_chars.label = Nombre max de caractères dans une question
10
- model_prepare_question.description = Modèle utilisé pour préparer une question avant de demander à Llama-index, par défaut : gpt-3.5-turbo
10
+ model_prepare_question.description = Modèle utilisé pour préparer une question avant de demander à LlamaIndex, par défaut : gpt-3.5-turbo
11
11
  model_prepare_question.label = Modèle pour la préparation des questions
12
- model_query.description = Modèle utilisé pour interroger Llama-index, par défaut : gpt-3.5-turbo.
12
+ model_query.description = Modèle utilisé pour interroger LlamaIndex, par défaut : gpt-3.5-turbo.
13
13
  model_query.label = Modèle
14
- plugin.description = Intègre le stockage Llama-index (Chat avec fichiers) dans n'importe quel chat et fournit des connaissances supplémentaires dans le contexte (à partir de fichiers et de l'historique du contexte dans la base de données)
15
- plugin.name = Chat avec fichiers (Llama-index, inline)
16
- prepare_question.description = Lorsqu'activé, la question sera préparée avant de demander à Llama-index afin de créer la meilleure requête.
17
- prepare_question.label = Préparer automatiquement la question avant de demander d'abord à Llama-index
18
- prepare_question_max_tokens.description = Nombre maximum de jetons dans la sortie lors de la préparation d'une question avant de demander à Llama-index.
14
+ plugin.description = Intègre le stockage LlamaIndex (Chat avec fichiers) dans n'importe quel chat et fournit des connaissances supplémentaires dans le contexte (à partir de fichiers et de l'historique du contexte dans la base de données)
15
+ plugin.name = Chat avec fichiers (LlamaIndex, inline)
16
+ prepare_question.description = Lorsqu'activé, la question sera préparée avant de demander à LlamaIndex afin de créer la meilleure requête.
17
+ prepare_question.label = Préparer automatiquement la question avant de demander d'abord à LlamaIndex
18
+ prepare_question_max_tokens.description = Nombre maximum de jetons dans la sortie lors de la préparation d'une question avant de demander à LlamaIndex.
19
19
  prepare_question_max_tokens.label = Nombre max de jetons pour la préparation des questions
20
- prompt.description = Prompt utilisé pour instruire comment utiliser des données supplémentaires fournies par Llama-index.
20
+ prompt.description = Prompt utilisé pour instruire comment utiliser des données supplémentaires fournies par LlamaIndex.
21
21
  prompt.label = Prompt
22
22
  syntax_prepare_question.description = Prompt système pour la préparation des questions.
23
23
  syntax_prepare_question.label = Prompt pour la préparation des questions
@@ -1,23 +1,23 @@
1
1
  [LOCALE]
2
- append_meta.description = Se abilitato, i metadati di Llama-index verranno aggiunti al contesto aggiuntivo
2
+ append_meta.description = Se abilitato, i metadati di LlamaIndex verranno aggiunti al contesto aggiuntivo
3
3
  append_meta.label = Aggiungi metadati al contesto
4
- ask_llama_first.description = Quando abilitato, Llama-index sarà interpellato per primo, e la risposta sarà utilizzata come conoscenza aggiuntiva nel prompt. Quando disabilitato, Llama-index sarà interpellato solo quando necessario. INFO: Disabilitato in modalità autonoma (tramite plugin)!
5
- ask_llama_first.label = Interroga prima Llama-index
4
+ ask_llama_first.description = Quando abilitato, LlamaIndex sarà interpellato per primo, e la risposta sarà utilizzata come conoscenza aggiuntiva nel prompt. Quando disabilitato, LlamaIndex sarà interpellato solo quando necessario. INFO: Disabilitato in modalità autonoma (tramite plugin)!
5
+ ask_llama_first.label = Interroga prima LlamaIndex
6
6
  idx.description = ID degli indici da utilizzare, predefinito: base, separati da virgola se vuoi utilizzare più di un indice alla volta.
7
7
  idx.label = Indici da utilizzare
8
- max_question_chars.description = Massimo numero di caratteri in una domanda quando si interroga Llama-index, 0 = nessun limite.
8
+ max_question_chars.description = Massimo numero di caratteri in una domanda quando si interroga LlamaIndex, 0 = nessun limite.
9
9
  max_question_chars.label = Massimo di caratteri nella domanda
10
- model_prepare_question.description = Modello usato per preparare una domanda prima di interrogare Llama-index, predefinito: gpt-3.5-turbo
10
+ model_prepare_question.description = Modello usato per preparare una domanda prima di interrogare LlamaIndex, predefinito: gpt-3.5-turbo
11
11
  model_prepare_question.label = Modello per la preparazione della domanda
12
- model_query.description = Modello usato per interrogare Llama-index, predefinito: gpt-3.5-turbo.
12
+ model_query.description = Modello usato per interrogare LlamaIndex, predefinito: gpt-3.5-turbo.
13
13
  model_query.label = Modello
14
- plugin.description = Integra lo storage Llama-index (Chat con file) in qualsiasi chat e fornisce conoscenze aggiuntive nel contesto (da file e dalla cronologia del contesto nel database)
15
- plugin.name = Chat con file (Llama-index, inline)
16
- prepare_question.description = Quando abilitato, la domanda verrà preparata prima di interrogare Llama-index per creare la migliore query.
17
- prepare_question.label = Prepara automaticamente la domanda prima di interrogare prima Llama-index
18
- prepare_question_max_tokens.description = Numero massimo di token in uscita quando si prepara una domanda prima di interrogare Llama-index.
14
+ plugin.description = Integra lo storage LlamaIndex (Chat con file) in qualsiasi chat e fornisce conoscenze aggiuntive nel contesto (da file e dalla cronologia del contesto nel database)
15
+ plugin.name = Chat con file (LlamaIndex, inline)
16
+ prepare_question.description = Quando abilitato, la domanda verrà preparata prima di interrogare LlamaIndex per creare la migliore query.
17
+ prepare_question.label = Prepara automaticamente la domanda prima di interrogare prima LlamaIndex
18
+ prepare_question_max_tokens.description = Numero massimo di token in uscita quando si prepara una domanda prima di interrogare LlamaIndex.
19
19
  prepare_question_max_tokens.label = Massimo di token in uscita per la preparazione della domanda
20
- prompt.description = Prompt utilizzato per istruire come utilizzare i dati aggiuntivi forniti da Llama-index.
20
+ prompt.description = Prompt utilizzato per istruire come utilizzare i dati aggiuntivi forniti da LlamaIndex.
21
21
  prompt.label = Prompt
22
22
  syntax_prepare_question.description = Prompt di sistema per la preparazione della domanda.
23
23
  syntax_prepare_question.label = Prompt per la preparazione della domanda
@@ -1,23 +1,23 @@
1
1
  [LOCALE]
2
- append_meta.description = Jeśli włączone, metadane z Llama-index zostaną dołączone do dodatkowego kontekstu
2
+ append_meta.description = Jeśli włączone, metadane z LlamaIndex zostaną dołączone do dodatkowego kontekstu
3
3
  append_meta.label = Dołącz metadane do kontekstu
4
- ask_llama_first.description = Kiedy włączone, Llama-index zostanie zapytany jako pierwszy, a odpowiedź zostanie użyta jako dodatkowa wiedza w prompt. Kiedy wyłączone, Llama-index zostanie zapytany tylko wtedy, gdy będzie to potrzebne. INFO: Wyłączone w trybie autonomicznym (poprzez wtyczkę)!
5
- ask_llama_first.label = Pytaj Llama-index jako pierwszy
4
+ ask_llama_first.description = Kiedy włączone, LlamaIndex zostanie zapytany jako pierwszy, a odpowiedź zostanie użyta jako dodatkowa wiedza w prompt. Kiedy wyłączone, LlamaIndex zostanie zapytany tylko wtedy, gdy będzie to potrzebne. INFO: Wyłączone w trybie autonomicznym (poprzez wtyczkę)!
5
+ ask_llama_first.label = Pytaj LlamaIndex jako pierwszy
6
6
  idx.description = ID używanych indeksów, domyślnie: base, rozdziel przecinkami jeśli chcesz użyć więcej niż jeden indeks naraz.
7
7
  idx.label = Używane indeksy
8
- max_question_chars.description = Maksymalna liczba znaków w pytaniu podczas zapytania do Llama-index, 0 = bez limitu.
8
+ max_question_chars.description = Maksymalna liczba znaków w pytaniu podczas zapytania do LlamaIndex, 0 = bez limitu.
9
9
  max_question_chars.label = Maksymalna liczba znaków w pytaniu
10
- model_prepare_question.description = Model używany do przygotowania pytania przed zapytaniem Llama-index, domyślnie: gpt-3.5-turbo
10
+ model_prepare_question.description = Model używany do przygotowania pytania przed zapytaniem LlamaIndex, domyślnie: gpt-3.5-turbo
11
11
  model_prepare_question.label = Model do przygotowywania pytania
12
- model_query.description = Model używany do zapytania Llama-index, domyślnie: gpt-3.5-turbo.
12
+ model_query.description = Model używany do zapytania LlamaIndex, domyślnie: gpt-3.5-turbo.
13
13
  model_query.label = Model
14
- plugin.description = Integruje przechowywanie Llama-index (Chat z plikami) w dowolnym czacie i dostarcza dodatkową wiedzę do kontekstu (z plików i z historii kontekstu w bazie danych)
15
- plugin.name = Chat z plikami (Llama-index, inline)
16
- prepare_question.description = Kiedy włączone, pytanie zostanie przygotowane przed zapytaniem Llama-index, aby stworzyć najlepsze zapytanie.
17
- prepare_question.label = Automatycznie przygotuj pytanie przed zapytaniem Llama-index
18
- prepare_question_max_tokens.description = Maksymalna liczba tokenów w wyjściu podczas przygotowywania pytania przed zapytaniem Llama-index.
14
+ plugin.description = Integruje przechowywanie LlamaIndex (Chat z plikami) w dowolnym czacie i dostarcza dodatkową wiedzę do kontekstu (z plików i z historii kontekstu w bazie danych)
15
+ plugin.name = Chat z plikami (LlamaIndex, inline)
16
+ prepare_question.description = Kiedy włączone, pytanie zostanie przygotowane przed zapytaniem LlamaIndex, aby stworzyć najlepsze zapytanie.
17
+ prepare_question.label = Automatycznie przygotuj pytanie przed zapytaniem LlamaIndex
18
+ prepare_question_max_tokens.description = Maksymalna liczba tokenów w wyjściu podczas przygotowywania pytania przed zapytaniem LlamaIndex.
19
19
  prepare_question_max_tokens.label = Maksymalna liczba tokenów dla przygotowania pytania
20
- prompt.description = Prompt używany do instruowania jak użyć dodatkowych danych dostarczonych z Llama-index.
20
+ prompt.description = Prompt używany do instruowania jak użyć dodatkowych danych dostarczonych z LlamaIndex.
21
21
  prompt.label = Prompt
22
22
  syntax_prepare_question.description = Systemowy prompt do przygotowania pytania.
23
23
  syntax_prepare_question.label = Prompt do przygotowania pytania
@@ -1,23 +1,23 @@
1
1
  [LOCALE]
2
- append_meta.description = Якщо ввімкнено, метадані з Llama-index будуть додані до додаткового контексту
2
+ append_meta.description = Якщо ввімкнено, метадані з LlamaIndex будуть додані до додаткового контексту
3
3
  append_meta.label = Додати метадані до контексту
4
- ask_llama_first.description = Коли ввімкнено, спочатку буде запитано Llama-index, і відповідь буде використана як додаткові знання у prompt. Коли вимкнено, Llama-index буде запитано лише за потреби. ІНФО: Вимкнено у автономному режимі (через плагін)!
5
- ask_llama_first.label = Запитувати спочатку Llama-index
4
+ ask_llama_first.description = Коли ввімкнено, спочатку буде запитано LlamaIndex, і відповідь буде використана як додаткові знання у prompt. Коли вимкнено, LlamaIndex буде запитано лише за потреби. ІНФО: Вимкнено у автономному режимі (через плагін)!
5
+ ask_llama_first.label = Запитувати спочатку LlamaIndex
6
6
  idx.description = ID індексів для використання, за замовчуванням: base, розділити комами, якщо хочете використовувати більше одного індексу одночасно.
7
7
  idx.label = Індекси для використання
8
- max_question_chars.description = Максимальна кількість символів у запитанні при зверненні до Llama-index, 0 = без обмеження.
8
+ max_question_chars.description = Максимальна кількість символів у запитанні при зверненні до LlamaIndex, 0 = без обмеження.
9
9
  max_question_chars.label = Максимум символів у запитанні
10
- model_prepare_question.description = Модель, що використовується для підготовки запитань перед зверненням до Llama-index, за замовчуванням: gpt-3.5-turbo
10
+ model_prepare_question.description = Модель, що використовується для підготовки запитань перед зверненням до LlamaIndex, за замовчуванням: gpt-3.5-turbo
11
11
  model_prepare_question.label = Модель для підготовки запитань
12
- model_query.description = Модель, що використовується для запиту у Llama-index, за замовчуванням: gpt-3.5-turbo.
12
+ model_query.description = Модель, що використовується для запиту у LlamaIndex, за замовчуванням: gpt-3.5-turbo.
13
13
  model_query.label = Модель
14
- plugin.description = Інтегрує зберігання даних Llama-index (Чат з файлами) в будь-який чат і надає додаткові знання для контексту (з файлів та з історії контексту в базі даних)
15
- plugin.name = Чат з файлами (Llama-index, вбудований)
16
- prepare_question.description = Коли ввімкнено, запитання буде підготовлено перед зверненням до Llama-index для створення найкращого запиту.
17
- prepare_question.label = Автоматично підготувати запитання перед запитом Llama-index на початку
18
- prepare_question_max_tokens.description = Максимальна кількість токенів у виході при підготовці запитання перед зверненням до Llama-index.
14
+ plugin.description = Інтегрує зберігання даних LlamaIndex (Чат з файлами) в будь-який чат і надає додаткові знання для контексту (з файлів та з історії контексту в базі даних)
15
+ plugin.name = Чат з файлами (LlamaIndex, вбудований)
16
+ prepare_question.description = Коли ввімкнено, запитання буде підготовлено перед зверненням до LlamaIndex для створення найкращого запиту.
17
+ prepare_question.label = Автоматично підготувати запитання перед запитом LlamaIndex на початку
18
+ prepare_question_max_tokens.description = Максимальна кількість токенів у виході при підготовці запитання перед зверненням до LlamaIndex.
19
19
  prepare_question_max_tokens.label = Максимум токенів для підготовки запитання
20
- prompt.description = Prompt, який використовується для інструкцій, як використовувати додаткові дані, надані Llama-index.
20
+ prompt.description = Prompt, який використовується для інструкцій, як використовувати додаткові дані, надані LlamaIndex.
21
21
  prompt.label = Prompt
22
22
  syntax_prepare_question.description = Системний prompt для підготовки запитання.
23
23
  syntax_prepare_question.label = Prompt для підготовки запитання
@@ -1,23 +1,23 @@
1
1
  [LOCALE]
2
- append_meta.description = 如果启用,将把Llama-index的元数据附加到额外上下文中
2
+ append_meta.description = 如果启用,将把LlamaIndex的元数据附加到额外上下文中
3
3
  append_meta.label = 将元数据追加到上下文中
4
- ask_llama_first.description = 如果启用,将首先询问Llama-index,并将回答作为在prompt中使用的额外知识。禁用时,只在需要时才询问Llama-index。INFO:在自主模式(通过插件)中禁用!
5
- ask_llama_first.label = 首先询问Llama-index
4
+ ask_llama_first.description = 如果启用,将首先询问LlamaIndex,并将回答作为在prompt中使用的额外知识。禁用时,只在需要时才询问LlamaIndex。INFO:在自主模式(通过插件)中禁用!
5
+ ask_llama_first.label = 首先询问LlamaIndex
6
6
  idx.description = 要使用的索引的ID,默认为:base,如果想要同时使用多个索引,请用逗号分隔。
7
7
  idx.label = 要使用的索引
8
- max_question_chars.description = 查询Llama-index时问题中的最大字符数,0 = 无限制。
8
+ max_question_chars.description = 查询LlamaIndex时问题中的最大字符数,0 = 无限制。
9
9
  max_question_chars.label = 问题中的最大字符数
10
- model_prepare_question.description = 用于在询问Llama-index之前准备问题的模型,默认为:gpt-3.5-turbo
10
+ model_prepare_question.description = 用于在询问LlamaIndex之前准备问题的模型,默认为:gpt-3.5-turbo
11
11
  model_prepare_question.label = 准备问题的模型
12
- model_query.description = 用于查询Llama-index的模型,默认为:gpt-3.5-turbo。
12
+ model_query.description = 用于查询LlamaIndex的模型,默认为:gpt-3.5-turbo。
13
13
  model_query.label = 模型
14
- plugin.description = 将Llama-index(文件聊天)存储集成到任何聊天中,并提供来自文件和数据库中上下文历史的额外上下文知识
15
- plugin.name = 文件聊天(Llama-index,内联)
16
- prepare_question.description = 如果启用,在询问Llama-index之前,将准备问题以创建最佳查询。
17
- prepare_question.label = 在首次询问Llama-index之前自动准备问题
18
- prepare_question_max_tokens.description = 在询问Llama-index之前准备问题时输出中的最大令牌数。
14
+ plugin.description = 将LlamaIndex(文件聊天)存储集成到任何聊天中,并提供来自文件和数据库中上下文历史的额外上下文知识
15
+ plugin.name = 文件聊天(LlamaIndex,内联)
16
+ prepare_question.description = 如果启用,在询问LlamaIndex之前,将准备问题以创建最佳查询。
17
+ prepare_question.label = 在首次询问LlamaIndex之前自动准备问题
18
+ prepare_question_max_tokens.description = 在询问LlamaIndex之前准备问题时输出中的最大令牌数。
19
19
  prepare_question_max_tokens.label = 准备问题的最大输出令牌数
20
- prompt.description = 用于指导如何使用Llama-index提供的额外数据的提示。
20
+ prompt.description = 用于指导如何使用LlamaIndex提供的额外数据的提示。
21
21
  prompt.label = 提示
22
22
  syntax_prepare_question.description = 准备问题的系统提示。
23
23
  syntax_prepare_question.label = 准备问题的提示
@@ -6,13 +6,17 @@
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.11.23 00:00:00 #
9
+ # Updated Date: 2024.11.26 02:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import json
13
13
 
14
14
 
15
15
  class AttachmentItem:
16
+
17
+ TYPE_FILE = 'file'
18
+ TYPE_URL = 'url'
19
+
16
20
  def __init__(self):
17
21
  """
18
22
  Attachment item
@@ -28,6 +32,7 @@ class AttachmentItem:
28
32
  self.consumed = False
29
33
  self.size = 0
30
34
  self.send = False
35
+ self.type = self.TYPE_FILE
31
36
 
32
37
  def serialize(self) -> dict:
33
38
  """
@@ -44,6 +49,7 @@ class AttachmentItem:
44
49
  'remote': self.remote,
45
50
  'ctx': self.ctx,
46
51
  'vector_store_ids': self.vector_store_ids,
52
+ 'type': self.type,
47
53
  'meta_id': self.meta_id,
48
54
  'send': self.send
49
55
  }
@@ -70,6 +76,8 @@ class AttachmentItem:
70
76
  self.ctx = data['ctx']
71
77
  if 'vector_store_ids' in data:
72
78
  self.vector_store_ids = data['vector_store_ids']
79
+ if 'type' in data:
80
+ self.type = data['type']
73
81
  if 'meta_id' in data:
74
82
  self.meta_id = data['meta_id']
75
83
  if 'send' in data:
pygpt_net/item/ctx.py CHANGED
@@ -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.11.23 00:00:00 #
9
+ # Updated Date: 2024.11.26 19:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import copy
@@ -58,6 +58,7 @@ class CtxItem:
58
58
  self.current = False
59
59
  self.internal = False
60
60
  self.is_vision = False
61
+ self.is_audio = False
61
62
  self.idx = 0
62
63
  self.first = False
63
64
  self.live = False # True if is current flow (not loaded from DB)
@@ -72,6 +73,9 @@ class CtxItem:
72
73
  self.sub_reply = False # sub call reply
73
74
  self.hidden = False # hidden context
74
75
  self.pid = 0
76
+ self.audio_id = None
77
+ self.audio_output = None
78
+ self.audio_expires_ts = 0
75
79
 
76
80
 
77
81
  @property
@@ -193,6 +197,8 @@ class CtxItem:
193
197
  "thread": self.thread,
194
198
  "msg_id": self.msg_id,
195
199
  "run_id": self.run_id,
200
+ "audio_id": self.audio_id,
201
+ "audio_expires_ts": self.audio_expires_ts,
196
202
  "input_name": self.input_name,
197
203
  "output_name": self.output_name,
198
204
  "input_timestamp": self.input_timestamp,
@@ -246,6 +252,8 @@ class CtxItem:
246
252
  self.thread = data.get("thread", None)
247
253
  self.msg_id = data.get("msg_id", None)
248
254
  self.run_id = data.get("run_id", None)
255
+ self.audio_id = data.get("audio_id", None)
256
+ self.audio_expires_ts = data.get("audio_expires_ts", None)
249
257
  self.input_name = data.get("input_name", None)
250
258
  self.output_name = data.get("output_name", None)
251
259
  self.input_timestamp = data.get("input_timestamp", None)
pygpt_net/item/preset.py CHANGED
@@ -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.11.15 00:00:00 #
9
+ # Updated Date: 2024.11.26 19:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import json
@@ -30,6 +30,7 @@ class PresetItem:
30
30
  self.agent = False
31
31
  self.agent_llama = False
32
32
  self.expert = False
33
+ self.audio = False
33
34
  self.temperature = 1.0
34
35
  self.filename = None
35
36
  self.model = None
@@ -63,6 +64,7 @@ class PresetItem:
63
64
  "agent": self.agent,
64
65
  "agent_llama": self.agent_llama,
65
66
  "expert": self.expert,
67
+ "audio": self.audio,
66
68
  "temperature": self.temperature,
67
69
  "filename": self.filename,
68
70
  "model": self.model,
@@ -105,6 +107,8 @@ class PresetItem:
105
107
  self.agent_llama = data["agent_llama"]
106
108
  if "expert" in data:
107
109
  self.expert = data["expert"]
110
+ if "audio" in data:
111
+ self.audio = data["audio"]
108
112
  if "temperature" in data:
109
113
  self.temperature = data["temperature"]
110
114
  if "filename" in data:
pygpt_net/launcher.py CHANGED
@@ -13,6 +13,7 @@ import sys
13
13
  import argparse
14
14
  from logging import ERROR, WARNING, INFO, DEBUG
15
15
 
16
+ from PySide6 import QtCore
16
17
  from PySide6.QtCore import QCoreApplication, Qt
17
18
  from PySide6.QtGui import QScreen
18
19
  from PySide6.QtWidgets import QApplication
@@ -100,6 +101,7 @@ class Launcher:
100
101
  Platforms.prepare() # setup platform specific options
101
102
  QCoreApplication.setAttribute(Qt.AA_ShareOpenGLContexts)
102
103
  self.app = QApplication(sys.argv)
104
+ self.app.setAttribute(QtCore.Qt.AA_DontUseNativeMenuBar)
103
105
  self.window = MainWindow(self.app, args=args)
104
106
  self.shortcut_filter = GlobalShortcutFilter(self.window)
105
107
 
@@ -225,7 +227,7 @@ class Launcher:
225
227
 
226
228
  def add_agent(self, agent: BaseAgent):
227
229
  """
228
- Register agent (Llama-index agent)
230
+ Register agent (LlamaIndex agent)
229
231
 
230
232
  :param agent: Agent instance
231
233
  """
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ # ================================================== #
4
+ # This file is a part of PYGPT package #
5
+ # Website: https://pygpt.net #
6
+ # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
+ # MIT License #
8
+ # Created By : Marcin Szczygliński #
9
+ # Updated Date: 2024.11.26 19:00:00 #
10
+ # ================================================== #
11
+
12
+ from sqlalchemy import text
13
+
14
+ from .base import BaseMigration
15
+
16
+
17
+ class Version20241126170000(BaseMigration):
18
+ def __init__(self, window=None):
19
+ super(Version20241126170000, self).__init__(window)
20
+ self.window = window
21
+
22
+ def up(self, conn):
23
+ conn.execute(text("""
24
+ ALTER TABLE ctx_item ADD COLUMN audio_id TEXT;
25
+ """))
26
+ conn.execute(text("""
27
+ ALTER TABLE ctx_item ADD COLUMN audio_expires_ts INTEGER;
28
+ """))
@@ -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.11.23 00:00:00 #
9
+ # Updated Date: 2024.11.26 19:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from .Version20231227152900 import Version20231227152900 # 2.0.59
@@ -21,6 +21,7 @@ from .Version20240408180000 import Version20240408180000 # 2.1.41
21
21
  from .Version20240426050000 import Version20240426050000 # 2.1.79
22
22
  from .Version20240501030000 import Version20240501030000 # 2.2.7
23
23
  from .Version20241122130000 import Version20241122130000 # 2.4.21
24
+ from .Version20241126170000 import Version20241126170000 # 2.4.34
24
25
 
25
26
  class Migrations:
26
27
  def __init__(self):
@@ -46,4 +47,5 @@ class Migrations:
46
47
  Version20240426050000(), # 2.1.79
47
48
  Version20240501030000(), # 2.2.7
48
49
  Version20241122130000(), # 2.4.21
50
+ Version20241126170000(), # 2.4.34
49
51
  ]
@@ -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.11.21 20:00:00 #
9
+ # Updated Date: 2024.11.26 19:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os
@@ -343,6 +343,7 @@ class Plugin(BasePlugin):
343
343
  worker.signals.destroyed.connect(self.handle_destroy)
344
344
  worker.signals.started.connect(self.handle_started)
345
345
  worker.signals.stopped.connect(self.handle_stop)
346
+ worker.signals.on_realtime.connect(self.handle_realtime)
346
347
 
347
348
  worker.run_async()
348
349
 
@@ -371,6 +372,15 @@ class Plugin(BasePlugin):
371
372
  """
372
373
  self.window.ui.plugin_addon['audio.input'].set_status(status)
373
374
 
375
+ @Slot(str)
376
+ def handle_realtime(self, path: str):
377
+ """
378
+ Handle realtime audio input
379
+
380
+ :param path: audio input file path
381
+ """
382
+ self.window.controller.chat.audio.handle_input(path)
383
+
374
384
  @Slot(object, object)
375
385
  def handle_input(self, text: str, ctx: CtxItem = None):
376
386
  """
@@ -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.11.18 21:00:00 #
9
+ # Updated Date: 2024.11.26 19:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os.path
@@ -22,6 +22,7 @@ from pygpt_net.plugin.base.worker import BaseWorker, BaseSignals
22
22
 
23
23
  class WorkerSignals(BaseSignals):
24
24
  transcribed = Signal(str, str)
25
+ on_realtime = Signal(str)
25
26
 
26
27
 
27
28
  class Worker(BaseWorker):
@@ -73,6 +74,13 @@ class Worker(BaseWorker):
73
74
  if os.path.exists(self.path):
74
75
  # set status
75
76
  self.status(trans('audio.speak.wait'))
77
+
78
+ # if multimodal audio, then only return path to audio file and do not transcribe
79
+ if self.plugin.window.controller.chat.audio.enabled():
80
+ self.signals.on_realtime.emit(self.path)
81
+ self.status('')
82
+ return
83
+
76
84
  # transcribe audio
77
85
  transcript = self.plugin.get_provider().transcribe(self.path)
78
86
  self.status('')