Skip to content

Commit

Permalink
UI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
szczyglis-dev committed Dec 8, 2023
1 parent 61db183 commit c1f62ee
Show file tree
Hide file tree
Showing 17 changed files with 284 additions and 122 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PYGPT v2

Release: **2.0.3** build: **2023.12.07** | Official website: https://pygpt.net | Docs: https://pygpt.readthedocs.io
Release: **2.0.4** build: **2023.12.08** | Official website: https://pygpt.net | Docs: https://pygpt.readthedocs.io

PyPi: https://pypi.org/project/pygpt-net

Expand All @@ -14,9 +14,9 @@ This assistant offers multiple modes of operation such as chat, assistants, comp

For audio interactions, **PYGPT** includes speech synthesis using the `Microsoft Azure Text-to-Speech API` and `OpenAI's TTS API`. Additionally, it features speech recognition capabilities provided by `OpenAI Whisper`, enabling the application to understand spoken commands and transcribe audio inputs into text. It features context memory with save and load functionality, enabling users to resume interactions from predefined points in the conversation. Prompt creation and management are streamlined through an intuitive preset system.

**PYGPT**'s functionality extends through plugin support, allowing for custom enhancements. Its multi-modal capabilities make it an adaptable tool for a range of AI-assisted operations, such as text-based interactions, system automation, vision applications, natural language processing via Langchain, and creative image synthesis.
**PYGPT**'s functionality extends through plugin support, allowing for custom enhancements. Its multi-modal capabilities make it an adaptable tool for a range of AI-assisted operations, such as text-based interactions, system automation, daily assisting, vision applications, natural language processing, code generation and image creation.

Multiple operation modes are included, such as chatbot, text completion, assistant, vision, Langchain, and image generation, making **PYGPT** a comprehensive tool for many AI-driven tasks.
Multiple operation modes are included, such as chat, text completion, assistant, vision, Langchain, commands execution and image generation, making **PYGPT** a comprehensive tool for many AI-driven tasks.

![v2_main](https://github.com/szczyglis-dev/extended-dump-bundle/assets/61396542/0c55c04c-130f-412d-8104-f5b4f7f19e7a)

Expand Down Expand Up @@ -943,6 +943,11 @@ may consume additional tokens that are not displayed in the main window.

# CHANGELOG

## 2.0.4 (2023-12-08)

- Added configuration options for plugins: Files I/O, Code Interpreter
- UI fixes

## 2.0.3 (2023-12-07)

- Python code execution fix
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
project = 'PYGPT'
copyright = '2023, pygpt.net'
author = 'szczyglis-dev, Marcin Szczygliński'
release = '2.0.3'
release = '2.0.4'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
PYGPT v2 - pygpt.net
====================

| **Last update:** 2023-12-07 21:00
| **Last update:** 2023-12-08 11:00
| **Project website:** https://pygpt.net
| **GitHub:** https://github.com/szczyglis-dev/py-gpt
| **PyPI:** https://pypi.org/project/pygpt-net
| **Release:** 2.0.3 (2023-12-07)
| **Release:** 2.0.4 (2023-12-08)
.. toctree::
:maxdepth: 3
Expand Down
4 changes: 2 additions & 2 deletions docs/source/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ This assistant offers multiple modes of operation such as chat, assistants, comp

For audio interactions, **PYGPT** includes speech synthesis using the ``Microsoft Azure Text-to-Speech API`` and ``OpenAI's TTS API``. Additionally, it features speech recognition capabilities provided by ``OpenAI Whisper``, enabling the application to understand spoken commands and transcribe audio inputs into text. It features context memory with save and load functionality, enabling users to resume interactions from predefined points in the conversation. Prompt creation and management are streamlined through an intuitive preset system.

**PYGPT**'s functionality extends through plugin support, allowing for custom enhancements. Its multi-modal capabilities make it an adaptable tool for a range of AI-assisted operations, such as text-based interactions, system automation, vision applications, natural language processing via Langchain, and creative image synthesis.
**PYGPT**'s functionality extends through plugin support, allowing for custom enhancements. Its multi-modal capabilities make it an adaptable tool for a range of AI-assisted operations, such as text-based interactions, system automation, daily assisting, vision applications, natural language processing, code generation and image creation.

Multiple operation modes are included, such as chatbot, text completion, assistant, vision, Langchain, and image generation, making **PYGPT** a comprehensive tool for many AI-driven tasks.
Multiple operation modes are included, such as chatbot, text completion, assistant, vision, Langchain, commands execution and image generation, making **PYGPT** a comprehensive tool for many AI-driven tasks.

.. image:: images/v2_main.png
:width: 800
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pygpt-net"
version = "2.0.3"
version = "2.0.4"
description = "GPT4, GPT4-V, GPT3, Whisper, TTS and DALL-E 3 AI desktop assistant with chatbot, text completion and image analyze and image generation"
readme = "README.md"
authors = [{ name = "Marcin Szczygliński", email = "[email protected]" }]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

VERSION = '2.0.3'
VERSION = '2.0.4'
DESCRIPTION = 'GPT4, GPT4-V, GPT3, Whisper, TTS and DALL-E 3 AI desktop assistant with chatbot, text completion and ' \
'image analyze and image generation'
LONG_DESCRIPTION = 'A package containing a GPT4, GPT4-V, GPT3, Whisper, TTS and DALL-E 3 AI desktop assistant, chatbot, ' \
Expand Down
5 changes: 5 additions & 0 deletions src/pygpt_net/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.0.4 (2023-12-08)

- Added configuration options for plugins: Files I/O, Code Interpreter
- UI fixes

2.0.3 (2023-12-07)

- Python code execution fix
Expand Down
6 changes: 3 additions & 3 deletions src/pygpt_net/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
# GitHub: https://github.com/szczyglis-dev/py-gpt #
# MIT License #
# Created By : Marcin Szczygliński #
# Updated Date: 2023.12.07 19:00:00 #
# Updated Date: 2023.12.08 11:00:00 #
# ================================================== #

__author__ = "Marcin Szczygliński"
__copyright__ = "Copyright 2023, Marcin Szczygliński"
__credits__ = ["Marcin Szczygliński"]
__license__ = "MIT"
__version__ = "2.0.3"
__build__ = "2023.12.07"
__version__ = "2.0.4"
__build__ = "2023.12.08"
__maintainer__ = "Marcin Szczygliński"
__github__ = "https://github.com/szczyglis-dev/py-gpt"
__website__ = "https://pygpt.net"
Expand Down
8 changes: 4 additions & 4 deletions src/pygpt_net/core/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# GitHub: https://github.com/szczyglis-dev/py-gpt #
# MIT License #
# Created By : Marcin Szczygliński #
# Updated Date: 2023.12.05 22:00:00 #
# Updated Date: 2023.12.08 11:00:00 #
# ================================================== #
import json

Expand Down Expand Up @@ -34,10 +34,10 @@ def get_prompt(self):
If you want to run command without any response, return only JSON object. Responses from commands will be returned
in "result" key. List of available commands is below.'''

#cmd += '\n"save_file": save data to file, params: "filename", "data"'
#cmd += '\n"read_file": read data from file, params: "filename"'
# syntax
# cmd += '\n"save_file": save data to file, params: "filename", "data"'
# cmd += '\n"read_file": read data from file, params: "filename"'
return cmd
return self.config['cmd_instruction']

def extract_cmds(self, response):
"""
Expand Down
3 changes: 2 additions & 1 deletion src/pygpt_net/core/controller/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def __init__(self, window=None):
:param window: main window object
"""
self.window = window
self.splitters = ["main", "main.output", "toolbox", "toolbox.mode", "toolbox.presets"]
# self.splitters = ["main", "main.output", "toolbox", "toolbox.mode", "toolbox.presets"]
self.splitters = ["main", "main.output", "toolbox", "toolbox.mode"] # prevent assistants column disappearing

def setup(self):
"""Setups layout"""
Expand Down
51 changes: 47 additions & 4 deletions src/pygpt_net/core/plugin/cmd_code_interpreter/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,50 @@ def __init__(self):
"type": "text",
"slider": False,
"label": "Python command template",
"description": "Python command template to execute",
"description": "Python command template to execute, use {filename} for filename placeholder",
"tooltip": "Python command template to execute, use {filename} for filename placeholder",
"value": 'python3 {filename}',
"min": None,
"max": None,
"multiplier": None,
"step": None,
}
self.options["cmd_code_execute"] = {
"type": "bool",
"slider": False,
"label": "Enable: Python Code Generate and Execute",
"description": "Allow Python code execution (generate and execute from file)",
"tooltip": "",
"value": True,
"min": None,
"max": None,
"multiplier": None,
"step": None,
}
self.options["cmd_code_execute_file"] = {
"type": "bool",
"slider": False,
"label": "Enable: Python Code Execute (File)",
"description": "Allow Python code execution from existing file",
"tooltip": "",
"value": True,
"min": None,
"max": None,
"multiplier": None,
"step": None,
}
self.options["cmd_sys_exec"] = {
"type": "bool",
"slider": False,
"label": "Enable: System Command Execute",
"description": "Allow system commands execution",
"tooltip": "",
"value": True,
"min": None,
"max": None,
"multiplier": None,
"step": None,
}
self.window = None
self.order = 100
self.allowed_cmds = ["code_execute", "sys_exec"]
Expand Down Expand Up @@ -110,6 +146,13 @@ def on_ctx_after(self, ctx):
"""
return ctx

def is_cmd_allowed(self, cmd):
"""Checks if cmd is allowed"""
key = "cmd_" + cmd
if key in self.options and self.options[key]["value"] is True:
return True
return False

def cmd_syntax(self, syntax):
"""Event: On cmd syntax prepare"""
syntax += '\n"code_execute": create and execute Python code, params: "filename", "code"'
Expand All @@ -122,7 +165,7 @@ def cmd(self, ctx, cmds):
for item in cmds:
try:
if item["cmd"] in self.allowed_cmds:
if item["cmd"] == "code_execute_file":
if item["cmd"] == "code_execute_file" and self.is_cmd_allowed("code_execute_file"):
msg = "Executing Python file: {}".format(item["params"]['filename'])
path = os.path.join(self.window.config.path, 'output', item["params"]['filename'])

Expand All @@ -144,7 +187,7 @@ def cmd(self, ctx, cmds):
ctx.results.append({"request": item, "result": stderr.decode("utf-8")})
ctx.reply = True # send result message

elif item["cmd"] == "code_execute":
elif item["cmd"] == "code_execute" and self.is_cmd_allowed("code_execute"):
msg = "Saving Python file: {}".format(item["params"]['filename'])
path = os.path.join(self.window.config.path, 'output', item["params"]['filename'])
data = item["params"]['code']
Expand All @@ -163,7 +206,7 @@ def cmd(self, ctx, cmds):
ctx.results.append({"request": item, "result": stderr.decode("utf-8")})
ctx.reply = True # send result message

elif item["cmd"] == "sys_exec":
elif item["cmd"] == "sys_exec" and self.is_cmd_allowed("sys_exec"):
msg = "Executing system command: {}".format(item["params"]['command'])
process = subprocess.Popen(item["params"]['command'], shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
Expand Down
Loading

0 comments on commit c1f62ee

Please sign in to comment.