rfwarn / ASCII_LLM_Maze

Good test for LLMs to see how they navigate.
GNU General Public License v3.0
1 stars 1 forks source link

Interaction between mazes and LLMs #2

Open HeyLun1211 opened 1 year ago

HeyLun1211 commented 1 year ago

Hello,I am very interested in this issue and have tried for a while without much success. How do you make the maze interact with LLMs (Maybe OpenAI's API or ChatGPT?)? Thank you.

rfwarn commented 1 year ago

Hi, I'm glad to see someone found interest in this. Right now, it's a manual process where the user is the middleman. You start the program and copy/paste it into the LLM textbox. When the LLM tells you what move they want to take, you enter the corresponding letter and the program will print the updated map. I need to make it combine all the outputs for a response in one print statement which could enable an API driven LLM the ability to interact with it directly. There are also options you can enable and disable to assist the AI.

sdick commented 5 months ago

Hello, I'm a professor of Computer Engineering at the University of Alberta. I'm interested in using your ASCII_LLM_MAZE as the problem-to-solve for a prompt engineering lab in my Intelligent Systems Engineering course. Could I ask that, if you're going to combine all of the outputs at once, you keep the current approach as a branch? I think I can use this as-is quite nicely for a lab on tree-structured prompts using LangChain.

rfwarn commented 5 months ago

Thanks for reaching out with interest in this project. Yes, I can create a separate branch for it if that would be useful to you. Just to clarify, I have multiple print statements that produce the output for each move, and the intention was to consolidate those into one output/print return for each move.

Best regards, RFWarn

sdick commented 5 months ago

Ah, I see. So it would still be a sequence of prints, and then waiting for a response. That does make more sense.

What I'm working on right now is to find a way to programmatically receive those text outputs into another Python script, and generate text responses to the ASCIImaze process from that second script. Initially it would just be another layer for a human, but that would also easily let me pass everything to an LLM as a prompt. If I can figure this out, I'll push an example script to you.

Best regards,

Scott Dick

rfwarn commented 5 months ago

Yes, it prints sections of the output in a few pieces until it reaches the input prompt again for each move. Here is an example of the different print functions used when making a valid move:

[image: image.png] each row of the maze is generated separately [image: image.png]

The issue that was noted was for an improvement to consolidate these separated print functions into a single variable for a single output for each move. This variable can be passed to a calling function in a return statement (if running it externally) for each turn which might be what you are looking for. Once this improvement has been implemented, in another Python file, you could import ASCIImaze and have this returned value be formatted and passed to an LLM API or however you wish to interface with it with or without user input. Let me know if this aligns with what you are trying to achieve.

Also to note, it only takes one letter/number for the input. If the response is longer or not one of the approved characters, it will give a response that an incorrect character was entered. That would need to be handled in your new python script. Something that you can easily find using regex or creating a custom tool if you are using Claude or a CustomGPT should work well.

Best regards, RFWarn

rfwarn commented 4 months ago

@sdick @HeyLun1211 I updated the program to work with external inputs. I added "Caller.py" as an example of how to use the maze externally in your own program. I believe this is what you are looking for. I may add another python file that is setup to run with Claude as another example.

sdick commented 4 months ago

Cool, I’ll have a look at it when I’m back from a family vacation. Thanks for the update!

Best regards,

Dr. Scott Dick Professor Dept. of Electrical & Computer Engineering University of Alberta

On Sun, Jul 7, 2024 at 2:53 PM Ryan Warn @.***> wrote:

@sdick https://github.com/sdick @HeyLun1211 https://github.com/HeyLun1211 I updated the program to work with external inputs. I added "Caller.py" as an example of how to use the maze externally in your own program. I believe this is what you are looking for. I may add another python file that is setup to run with Claude as another example.

— Reply to this email directly, view it on GitHub https://github.com/rfwarn/ASCII_LLM_Maze/issues/2#issuecomment-2212573570, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARAOZSYJHJY7GIFCRENZMDZLGTE7AVCNFSM6AAAAABKMED5DOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJSGU3TGNJXGA . You are receiving this because you were mentioned.Message ID: @.***>

rfwarn commented 4 months ago

Sounds good, hope you enjoy your vacation!

sdick commented 4 months ago

Hi Ryan,

I've tested out Caller.py, and it's working fine. I think this is exactly what I need for the lab exercise. The plan is actually to have the students use OpenAI's APIs (probably GPT4o-mini), in concert with Langchain and Chroma, to do a tree-of-thought solution for a maze problem (i.e. a depth-first search). Building a whole orchestrated LLM architecture with 4o-mini to solve this problem is definitely nuking fish in a pond... but then again that's the point of a lab exercise, getting the students to do a simple, understandable thing to introduce powerful tools. Your example with Claude, while a different approach to solving the maze, shoudl also be useful and helpful documentation. Who knows, someone in the class might even get interested in adding to the ACIIMaze project. Out of 120 students, there's usually at least a few tinkerers... 🙂

Best regards,

Scott Dick

On Mon, Jul 8, 2024 at 12:34 PM Ryan Warn @.***> wrote:

Sounds good, hope you enjoy your vacation!

— Reply to this email directly, view it on GitHub https://github.com/rfwarn/ASCII_LLM_Maze/issues/2#issuecomment-2214905440, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARAOZTF4JADCYSEFWBI3EDZLLLRPAVCNFSM6AAAAABKMED5DOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJUHEYDKNBUGA . You are receiving this because you were mentioned.Message ID: @.***>

-- Dr. Scott Dick Professor Dept. of Electrical & Computer Engineering University of Alberta

rfwarn commented 4 months ago

Hey Scott,

Just FYI, if you didn't already know, these emails are also posted in the repository under the original problem you commented on (I didn't realize at first).

That's great to hear and I hope it meets your needs. Let me know if you run into any issues. I'm curious to know how it works out.

The Claude example is more situated for my own use and exploration, but also to serve as a sample case.

sdick commented 4 months ago

Yep, I know. I’ll keep you posted on what I find.

Best regards,

Dr. Scott Dick Professor Dept. of Electrical & Computer Engineering University of Alberta

On Mon, Jul 22, 2024 at 1:32 PM Ryan Warn @.***> wrote:

Hey Scott,

Just FYI, if you didn't already know, these emails are also posted in the repository under the original problem you commented on (I didn't realize at first).

That's great to hear and I hope it meets your needs. Let me know if you run into any issues. I'm curious to know how it works out.

The Claude example is more situated for my own use and exploration, but also to serve as a sample case.

— Reply to this email directly, view it on GitHub https://github.com/rfwarn/ASCII_LLM_Maze/issues/2#issuecomment-2243671610, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARAOZXYLNYVJHOSOMI4SYDZNVM5RAVCNFSM6AAAAABKMED5DOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBTGY3TCNRRGA . You are receiving this because you were mentioned.Message ID: @.***>