szczyglis-dev / py-gpt

Desktop AI Assistant powered by o1, GPT-4, GPT-4 Vision, Gemini, Claude, Llama 3, Bielik, DALL-E, Langchain, Llama-index, chat, vision, voice control, image generation and analysis, agents, command execution, file upload/download, speech synthesis and recognition, access to Web, memory, presets, assistants, plugins, and more. Linux, Windows, Mac.
https://pygpt.net
Other
609 stars 115 forks source link

How to Use LangChain or Agent Mode #19

Closed diskun00 closed 4 days ago

diskun00 commented 9 months ago

Hi Marcin,

Thank you for creating this nice app! After worked with Langchain Agent last year, I was always looking forward to set up a local agent in my own laptop. Different from what I built in jupyter notebook, to have a UI for convenient interaction with the agent is really essential. I am so happy to see your project.

While setup agent mode, I find it not clear how to make it work. Could you give an example config? For example, i want to set up an agent

  1. which can access browser
  2. use python
  3. run bash commands

I saw your implemented plugins covered all. But how could i configure it in PyGPT? I used to code an LangChain anget and expose those plugins as functions with description so that agent knows which and how to utilize them.

Besides, I am unable to find setting panel but only see it in the first launch of the app. FYI, I run it using clone repo from M2 MBP. I think maybe if i can access the settings page, i might figure it out the problem as well. image

Thank you again!

szczyglis-dev commented 9 months ago

Hi ;)

The agent mode works very similarly here to what you described, but all the configuration for this is in the settings (Plugins -> Settings and Config -> Settings) which you don't see in the menu.

This will be a problem related to MacOS trying to manage menu items with specific names in its own way, when mapping them to a global menu:

https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar

To resolve this, in the current release (2.0.152), I removed all roles for menu items that are specially treated by MacOS, such as Settings, About, or Exit. This trick should help - please check if both Settings options now appear correctly in the menu and give me a feedback - if this doesn't help, I will try to solve it in another way.


How to use Agents:

Langchain:

Hope this helps ;)

diskun00 commented 9 months ago

Thank you for quick reply! Now i could see the setting after the pulling the code. Will check other features later.