-
Notifications
You must be signed in to change notification settings - Fork 131
Adding web UI using Replit #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Assistant generated file changes: - main.py: Add Flask web interface - templates/index.html: Create web interface template --- User prompt: I imported this open source project and created settings.py file as directed but when I run main.py I am getting error. Can you take a look at all files and figure out how to use this? We have to also create web ui for this. this is current error when I run main.py
…ation
Assistant generated file changes:
- simulation_engine/settings.py: Update OpenAI API key settings
---
User prompt:
great. I can see webview but when I ask question I get x = extract_relevance(curr_nodes, self.embeddings, focal_pt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/genagentsVishwas/genagents/modules/memory_stream.py", line 265, in extract_relevance
focal_embedding = get_text_embedding(focal_pt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/genagentsVishwas/simulation_engine/gpt_structure.py", line 162, in get_text_embedding
response = openai.embeddings.create(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/genagentsVishwas/.pythonlibs/lib/python3.12/site-packages/openai/_utils/_proxy.py", line 25, in __getattr__
proxied = self.__get_proxied__()
^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/genagentsVishwas/.pythonlibs/lib/python3.12/site-packages/openai/_utils/_proxy.py", line 61, in __get_proxied__
return self.__load__()
^^^^^^^^^^^^^^^
File "/home/runner/genagentsVishwas/.pythonlibs/lib/python3.12/site-packages/openai/_module_client.py", line 54, in __load__
return _load_client().embeddings
^^^^^^^^^^^^^^
File "/home/runner/genagentsVishwas/.pythonlibs/lib/python3.12/site-packages/openai/__init__.py", line 305, in _load_client
_client = _ModuleClient(
^^^^^^^^^^^^^^
File "/home/runner/genagentsVishwas/.pythonlibs/lib/python3.12/site-packages/openai/_client.py", line 92, in __init__
raise OpenAIError(
openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
172.31.196.3 - - [17/Dec/2024 14:36:32] "POST /chat HTTP/1.1" 500 -
…e processing Assistant generated file changes: - main.py: Update chat endpoint with better error handling - genagents/modules/interaction.py: Add error handling for utterance generation --- User prompt: now when I asked question I get this error
…ebugging Assistant generated file changes: - main.py: Update main.py for better agent initialization, Add required import --- User prompt: so can you please look at all files and determine sequence how we should run this? should we create agents first? do agents exist? I am getting this response in webui Agent: I apologize, but I'm having trouble processing that request.
Assistant generated file changes: - main.py: Create basic test implementation --- User prompt: still same response. lets start from basics. please explain me how this whole thing is supposed to work. read the documentation file as well in repository
Assistant generated file changes: - main.py: Improve error handling and response display - templates/index.html: Update template to show detailed response --- User prompt: ok same response in ui. how about we display whatever we receive back. is openai sending this response or some code logic
Assistant generated file changes: - agent_bank/populations/single_agent/software_engineer/scratch.json: Create software engineer agent profile - agent_bank/populations/single_agent/software_engineer/memory_stream/nodes.json: Add agent's memory nodes - agent_bank/populations/single_agent/software_engineer/memory_stream/embeddings.json: Add empty embeddings - agent_bank/populations/single_agent/software_engineer/meta.json: Add agent meta information - main.py: Update agent path --- User prompt: it is actual response. lets try creating new agent in agent bank and have conversation with it. The new agent is software engineer working in a fortune 500 company
…properly Assistant generated file changes: - main.py: Update chat endpoint to better handle agent responses --- User prompt: much better now I get this Error: Failed to process dialogue: 'I lead a team of 6 engineers working on cloud infrastructure and distributed systems. We focus on scalability and reliability of our core services.'
Assistant generated file changes: - main.py: Fix chat endpoint response handling --- User prompt: User: Hi There Agent: Error: Failed to process dialogue: 'I lead a team of 6 engineers working on cloud infrastructure and distributed systems. We focus on scalability and reliability of our core services.'
Assistant generated file changes: - main.py: Fix agent response handling --- User prompt: User: hi there Agent: Error: Failed to process dialogue: 'I lead a team of 6 engineers working on cloud infrastructure and distributed systems. We focus on scalability and reliability of our core services.'
Assistant generated file changes: - main.py: Fix agent response handling --- User prompt: something is still not right User: Hi there Agent: Error: Failed to process dialogue: 'I lead a team of 6 engineers working on cloud infrastructure and distributed systems. We focus on scalability and reliability of our core services.'
…ement Assistant generated file changes: - main.py: Fix agent initialization and response handling --- User prompt: think clearly. maybe some other error is happening. same response
Assistant generated file changes: - genagents/modules/interaction.py: Fix response parsing in utterance function --- User prompt: User: hi there Agent: Response: I apologize, but I'm having trouble processing that request. Raw: undefined Type: undefined
Assistant generated file changes:
- simulation_engine/gpt_structure.py: Add token limit to GPT requests
---
User prompt:
great. got the real issue now. lets trim request to send only 1000 tokens in request. : Response: GENERATION ERROR: Error code: 429 - {'error': {'message': 'Request too large for gpt-4 in organization org-6u73NljyOgBqe3qHX0ry6teK on tokens per min (TPM): Limit 10000, Requested 17728. The input or output tokens must be reduced in order to run successfully. Visit https://platform.openai.com/account/rate-limits to learn more.', 'type': 'tokens', 'param': None, 'code': 'rate_limit_exceeded'}}
Raw: undefined
Type: undefined
Assistant generated file changes: - templates/index.html: Add agent selector and header - main.py: Update chat endpoint to handle agent selection --- User prompt: ok much better response now. please cleanup a bit and how do i know with whom I am talking? Can you give some dropdown User: Hi There Agent: Response: ild as well. So certainly for me, I remember being very excited about moving to a new country, but also being very confused about a lot of things. The language, the culture, and just sort of the new life that I was supposed to lead. It's a lot of change for a 12-year-old. But I think what made it bearable, and what made it possible, was the fact that my parents were also going through their own version of that transition. So in some sense, I think we were able to sort of rely on each other and sort of help each other out during that transition. So it was tough, but it was also exciting and new. Raw: undefined Type: undefined
Assistant generated file changes: - templates/index.html: Add searchable dropdown and agent info display --- User prompt: so is it possible to give dropdown so that we can search agent. the first display agent persona and then start conversation?
Assistant generated file changes: - db/schema.sql: Create agents table schema - db/db.py: Add database connection and import logic --- User prompt: what are we going to search on . what is your suggestion? ideally we should store all agents in postgres and then we can search on different attributes
…and matching Assistant generated file changes: - db/db.py: Improve agent search functionality --- User prompt: hmm maybe search dialogue needs to have different fields. if i type age=25, sex='Female', race='White' nothing is returned
Assistant generated file changes: - templates/index.html: Add multiple search fields for agent attributes, Add styles for search fields, Add search function --- User prompt: hmm I see only single search box
…ctories Assistant generated file changes: - main.py: Add search endpoint - templates/index.html: Update frontend search handling --- User prompt: good. I can see more fields in search but when I search what is supposed to happen? Ideally we should be able to search in both folders ( single as well as gss and then get downdown for selecting agent populated with result set so we can have dialogue with them
Assistant generated file changes:
- main.py: Fix chat endpoint error handling
---
User prompt:
well I still see only agents from single-agent in dropdown so search is not working and if I select agent to start dialogue I get this rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/genagentsVishwas/.pythonlibs/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/genagentsVishwas/main.py", line 20, in search_agents
from db.db import search_agents_dialogue
File "/home/runner/genagentsVishwas/db/db.py", line 4, in <module>
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
172.31.196.3 - - [17/Dec/2024 16:03:55] "POST /search HTTP/1.1" 500 -
Initializing agent...
Agent initialized successfully
Dialogue error: 'I lead a team of 6 engineers working on cloud infrastructure and distributed systems. We focus on scalability and reliability of our core services.'
172.31.196.3 - - [17/Dec/2024 16:04:25] "POST /chat HTTP/1.1" 200 -
…dencies
Assistant generated file changes:
- main.py: Modify search to work without DB temporarily
- requirements.txt: Add psycopg2-binary to requirements
---
User prompt:
looks like search is giving error File "/home/runner/genagentsVishwas/.pythonlibs/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/genagentsVishwas/.pythonlibs/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/genagentsVishwas/main.py", line 20, in search_agents
from db.db import search_agents_dialogue
File "/home/runner/genagentsVishwas/db/db.py", line 4, in <module>
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
172.31.196.3 - - [17/Dec/2024 16:12:17] "POST /search HTTP/1.1" 500 -
Assistant generated file changes:
- main.py: Update search to work with files temporarily
---
User prompt:
search still not working File "/home/runner/genagentsVishwas/.pythonlibs/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/genagentsVishwas/.pythonlibs/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/genagentsVishwas/main.py", line 20, in search_agents
from db.db import search_agents_dialogue
File "/home/runner/genagentsVishwas/db/db.py", line 4, in <module>
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
172.31.196.3 - - [17/Dec/2024 16:12:17] "POST /search HTTP/1.1" 500 -
Assistant generated file changes: - main.py: Fix agent initialization in chat endpoint --- User prompt: great. search works now and I see dropdown populated with results but cant start conversation when I select agent
Assistant generated file changes: - templates/index.html: Fix message input enabling after agent selection --- User prompt: the type your message box remains disabled after selecting agent
Assistant generated file changes:
- genagents/modules/interaction.py: Clean up utterance response
---
User prompt:
looks great. just cleanup a response little bit {"utterance": "Well, I'm a 25-year-old male, born and raised in the US, specifically from Little Rock, AR. I've always been a bit towards the liberal side politically, although I identify as an independent, leaning close to democrat. I grew up living with my parents, both of whom have high school education. I also completed high school and currently have a job, but I'm on a break due to a temporary illness. I'm of white ethnicity, and I'm a practicing Catholic, just like when I was 16. I have never been married and I've never had active military duty. My total wealth is less than $5,000. I only speak English and I'm a US citizen."}
Assistant generated file changes:
- main.py: Clean up response display
---
User prompt:
hmm I still see utterences json instead of plain conversation User: Hi Aisha
Agent: {"utterance": "Hello! How can I assist you today?"}
Assistant generated file changes: - main.py: Add new routes for agent management - templates/index.html: Add agent management UI, Add agent management interface, Add JavaScript functions for agent management --- User prompt: great work so far. now take a look at other examples given in readme file. can we create webui for those actions like adding memories or generating new agents with persona
Assistant generated file changes: - templates/index.html: Update create agent form with all attributes, Update create agent JavaScript, Update manage section --- User prompt: hmm I can see create agent dialogue. I created one. where do I see and shouldn't we see all base attributes? also if I try to add memory it says select agent first. what is flow
Assistant generated file changes: - main.py: Add missing uuid import --- User prompt: looks like create agent is failing with http 500
…first Assistant generated file changes: - main.py: Fix create agent initialization --- User prompt: Generative agent does not exist in the current location. 172.31.196.26 - - [17/Dec/2024 17:48:33] "POST /create-agent HTTP/1.1" 500 -
…r handling Assistant generated file changes: - main.py: Fix reflect endpoint --- User prompt: 172.31.196.26 - - [17/Dec/2024 17:52:15] "POST /reflect HTTP/1.1" 500 - 172.31.196.26 - - [17/Dec/2024 17:52:29] "POST /reflect HTTP/1.1" 500 -
…r handling Assistant generated file changes: - main.py: Fix reflect endpoint initialization --- User prompt: 172.31.196.26 - - [17/Dec/2024 18:01:37] "POST /reflect HTTP/1.1" 500 -
Assistant generated file changes: - main.py: Add MemoryStream import --- User prompt: Agent initialization error: name 'MemoryStream' is not defined 172.31.196.26 - - [17/Dec/2024 18:04:15] "POST /reflect HTTP/1.1" 500 -
Assistant generated file changes: - main.py: Fix reflection generation --- User prompt: Agent initialization error: 'Childhood' 172.31.196.26 - - [17/Dec/2024 18:06:17] "POST /reflect HTTP/1.1" 500 -
Assistant generated file changes: - main.py: Fix agent initialization for reflection --- User prompt: Agent initialization error: 'Childhood' 172.31.196.26 - - [17/Dec/2024 18:06:17] "POST /reflect HTTP/1.1" 500 -
Assistant generated file changes: - main.py: Fix add memory endpoint initialization --- User prompt: well memory addition does not work. blance is fine
Assistant generated file changes: - main.py: Fix reflection generation --- User prompt: Reflection generation error: 'general' 172.31.196.26 - - [17/Dec/2024 18:29:41] "POST /reflect HTTP/1.1" 500 -
Assistant generated file changes: - genagents/genagents.py: Fix reflection method - main.py: Fix reflection endpoint --- User prompt: Reflection generation error: 'childhood' 172.31.196.26 - - [17/Dec/2024 18:36:15] "POST /reflect HTTP/1.1" 500 -
Assistant generated file changes: - genagents/modules/memory_stream.py: Fix reflection generation --- User prompt: no luck same error Reflection generation error: 'childhood' 172.31.196.26 - - [17/Dec/2024 19:11:05] "POST /reflect HTTP/1.1" 500 -
Assistant generated file changes: - templates/index.html: Add filterAgents function --- User prompt: I see filteragnet is not defined in console. does this have to do anything with memory not being stored
Added instructions for using web UI by importing repository in replit.
Settings.py suitable for replit import
|
Hi how do I use this in Replit? It’s not running on my side |
|
This is great, would love to talk to you VishwasK. Please reach out to https://www.linkedin.com/in/luisesilvavargas/ |
You can create new replit, fork this commit so you can import in replit and then deploy by adding openai key in secret |
Thanks. Glad you liked it |
|
Hi how do I get hold of you I have some specific questions. Do you have an email? |
Is there any place I can reach out? I'm reaching out to folks interested in this research. Would love to discuss what excites you about it and potential applications |
Hi, I'm really interested in this research. I'm working on an AI counselor product for psychological issues, and I believe generative/simulation agents have great potential for AI counseling applications. |
Added files for using Web Interface by reploying on replit. In replit create new project and import GitHub repository. You should be able to use web UI for different operations.
