Agentic Adventures -Side Quest LlamaLauncher Part 4

Adding a todo

I decided to add a todo list to the project so I can point the agent at it and create sub task.

For the initial test I have added the following

# TODO

## Phase 1: Web viewer

[ ] Add ability to set --host HOST  and --port PORT this should be below the api section. Default values should be 127.0.0.1 and 8080 respectively.
[ ] Update the central widget so the current UI is in a tab group called Model
[ ] Add another Tab group for Server
[ ] In the server tab group add a QWebEngineView that displays the server from above

I will now get it implement Phase1 from the todo.

Implement Phase 1 from [@TODO.md](file:///Volumes/teaching/Code/LLamaLauncher/TODO.md) 

First Issue I have encountered is the addition of webengine>=6.11.1 to the pyproject.toml.

× No solution found when resolving dependencies:
  ╰─▶ Because pyside6-webengine was not found in the package registry and your project depends on pyside6-webengine>=6.11.1, we
      can conclude that your project's requirements are unsatisfiable.

This is not needed so I have removed it, after that is seems to just go off and do the tasks. See AgentChat15.md

It tried to launch but failed, this is due to the other agent running on the same port / address. Once the other server is turned off it all works.

There are a couple of issues. First the web page need to be re-freshed once the server is online. May need to watch for the web address in the text for it to be launched and re-load.

The next part is the API key needs to be set for the server to run.

Let’s ask the agent how to fix the first thing.

When launching a new model, it takes some time for the model to load and the server to be active, we have to manually reload the web page once this is done. In the model output it will have the text http://HOST:PORT add a watch in the text output to find when this appears then refresh the web page to load the server. 

This got a little lost at the end so I had to stop the server (it was getting confused with my git worktrees) other than that this worked. AgentChat16.md

Lets see if we can persits the web state for keys / chats etc. I will ask the agent.

When the web view is loaded it forgets the last session's values (such as the API key and chats). Is there a way to save this data in the QWebViewWidget (cookies?)

It seems to think the soulution would be a Persistent QWebEngineProfile let’s get it to implement it.

Initial version had issues

 ./main.py
Traceback (most recent call last):
  File "/Volumes/teaching/Code/LLamaLauncher/./main.py", line 329, in <module>
    window = LlamaLaunchApp(host=args.host, port=args.port)
  File "/Volumes/teaching/Code/LLamaLauncher/./main.py", line 39, in __init__
    self._cache_dir: Path = self._create_cache_dir()
                            ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Volumes/teaching/Code/LLamaLauncher/./main.py", line 55, in _create_cache_dir
    cache_dir = Path(self.applicationDirPath()) / ".cache" / "llama-launcher"
                     ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'LlamaLaunchApp' object has no attribute 'applicationDirPath'

It took a few times with pasting in errors but in the end got the persitant storeage working!

See AgentChat17.md for details.

Next
Previous

Related