Giter VIP home page Giter VIP logo

gpteam's People

Contributors

alec2435 avatar haniaa avatar joshsny avatar renovate[bot] avatar ryderwishart avatar timconnorz avatar zoan37 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gpteam's Issues

chatgpt api call

It's very good to see open sourced code of the research "generative agents"! I have a question for this.

in this model, how frequently the chatgpt api is called? for each action/conversation generation of all agents? If so, the number of call for chatgpt api is same as number of agents? or one api call can control all agents at once?
thnks.

Failed to execute setup.py

During setup, the command "python setup.py" yields the following error

Poetry is already installed.
Creating .env file...
Traceback (most recent call last):
  File "C:\Users\evang\Desktop\conda-envs\stock-ai-trader\GPTeam\setup.py", line 60, in <module>
    subprocess.run(["cp", ".env.example", ".env"], check=True)
  File "C:\Users\evang\.conda\envs\stock-ai-trader-env\Lib\subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\evang\.conda\envs\stock-ai-trader-env\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\evang\.conda\envs\stock-ai-trader-env\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified

I am using windows 10.

Read Document Tool

Hi! I created the json file with the field "title" and also "content", but the the script can't find the document. I tried to save on the main folder, tried to append to the config.json. I just cant figure out how to read a file.
Any help is appreciated.
Thnx

Involve in the chat as a human

Thanks for your great work,
Is it possible to involve in the chat as a human and provide input to the world? If not what else is out there to try? Thanks.

command not found: poetry

I followed the instructions in README.md, and poetry run world returns an error message zsh: command not found: poetry 😢.

  ...
  • Installing websocket-client (1.5.2)
  • Installing wolframalpha (5.0.0)

Installing the current project: 101-ai (0.1.0)
Seed the database...
database reset
seeding the db - normal

Setup complete!

-> You are ready to run the world. Please set your OPENAI_API_KEY in .env and run `poetry run world` to get started.
╭─laurents at MacBook Pro de Laurent in ~/Documents/GPTeam on main✔
╰─± poetry run world
zsh: command not found: poetry

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency python-dotenv to v1.0.1
  • Update dependency aiosqlite to ^0.20.0
  • Update dependency pytz to v2023.4
  • Update dependency wolframalpha to v5.1.3
  • Update actions/checkout action to v4
  • Update actions/setup-python action to v5
  • Update dependency babel-standalone to v7
  • Update dependency black to v24
  • Update dependency openai to v1
  • Update dependency pytz to v2024
  • Update dependency supabase to v2
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/test_setup_script.yml
  • actions/checkout v3
  • actions/setup-python v2
html
src/web/templates/logs.html
  • babel-standalone 6.26.0
pep621
pyproject.toml
poetry
pyproject.toml
  • python >=3.9,<3.12
  • colorama ^0.4.6
  • python-dotenv ^1.0.0
  • openai ^0.27.4
  • google-search-results ^2.4.2
  • black ^23.3.0
  • supabase ^1.0.3
  • wolframalpha ^5.0.0
  • langchain ^0.0.144
  • pytz ^2023.3
  • hikari ^2.0.0.dev118
  • postgrest-py ^0.10.6
  • aiosqlite ^0.19.0
  • hyperdb-python ^0.1.3
  • quart ^0.18.4
  • anthropic ^0.2.10
  • websocket-client ^1.5.2

  • Check this box to trigger a request for Renovate to run again on this repository

uv loop not supporting PEP 517

apologies if this is obvious -- novice here

im on windows 11 and have been struggling to get this set up for a while

I am wondering if uv loop is necessary for everything to run or is it there solely for optimization

should I consider installing Docker or some type of linux environment?

Thank you in advance! :)

the error in terminal
Note: This error originates from the build backend, and is likely not a problem with poetry but with uvloop (0.17.0) not supporting PEP 517 builds.

Agent to agent messages can be addressed X in Y

pattern = r"(?P<sender>[\w\s]+) said to (?P<recipient>[\w\s]+): [\"'](?P<message>.*)[\"']"

I've got messages which are addressed to "everyone in location", which breaks this regex, as it doesn't expect recipient to have whitespace in it. This causes the sender_name, recipient, content = re.findall(pattern, event.description)[0]

Adding .* to the regex to allow the recipient to have spaces in it makes it work, though I'm not sure it wont break something else

With the .* added: pattern = r"(?P<sender>[\w\s]+) said to (?P<recipient>[\w\s]+.*): [\"'](?P<message>.*)[\"']"

Supabase db-reset command in setup.py fails

I re-cloned the repo and set up my openai api key + supabase credentials, but when running the python setup.py command I keep running into this issue:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/mohayat/projects/GPTeam/src/utils/database/reset.py", line 31, in main
    asyncio.run(reset())
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/mohayat/projects/GPTeam/src/utils/database/reset.py", line 17, in reset
    subprocess.run(["supabase", "db", "reset"])
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1917, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'supabase'
Traceback (most recent call last):
  File "/Users/mohayat/projects/GPTeam/setup.py", line 66, in <module>
    subprocess.run(["poetry", "run", "db-reset"], check=True)
  File "/Users/mohayat/.pyenv/versions/3.11.0/lib/python3.11/subprocess.py", line 569, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['poetry', 'run', 'db-reset']' returned non-zero exit status 1.

I've tried re-installing the supabase package and re-running the command to no avail.

poetry run db-reset issue

Running setup.py using Python 3.8.5 on MacOS 12.6.5 fails on "poetry run db-reset"

(base) davidlumpkin@Davids-MacBook-Pro GPTeam % python setup.py
Poetry is already installed.
Installing dependencies...
Installing dependencies from lock file

No dependencies to install or update

Installing the current project: 101-ai (0.1.0)
Seed the database...
Traceback (most recent call last):
File "", line 1, in
File "/Users/davidlumpkin/anaconda3/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/Users/davidlumpkin/src/GPTeam/src/utils/database/reset.py", line 8, in
from .seed import seed
File "/Users/davidlumpkin/src/GPTeam/src/utils/database/seed.py", line 5, in
from src.utils.database.base import Tables
File "/Users/davidlumpkin/src/GPTeam/src/utils/database/base.py", line 22, in
class DatabaseProviderSingleton(AbstractSingleton):
File "/Users/davidlumpkin/src/GPTeam/src/utils/database/base.py", line 24, in DatabaseProviderSingleton
async def get_by_id(self, table: Tables, id: str) -> list[dict[str, Any]]:
TypeError: 'type' object is not subscriptable
Traceback (most recent call last):
File "setup.py", line 66, in
subprocess.run(["poetry", "run", "db-reset"], check=True)
File "/Users/davidlumpkin/anaconda3/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['poetry', 'run', 'db-reset']' returned non-zero exit status 1.
(base) davidlumpkin@Davids-MacBook-Pro GPTeam % python --version
Python 3.8.5

The Documentation Is Not Clear

The repo does not really have context as what each file is about, and which one needs to be change for customization.

Failing to setup

Hi, Can someone help please? I'm trying to install on Windows 10. Getting this error after 'poetry run world'

D:\GPTeam>poetry run world
Traceback (most recent call last):
File "D:\GPTeam\src\main.py", line 35, in run_world
raise ValueError("No worlds found!")
ValueError: No worlds found!

When I try to do a database reset I get this:

D:\GPTeam>poetry run db-reset
Traceback (most recent call last):
File "", line 1, in
File "D:\GPTeam\src\utils\database\reset.py", line 28, in main
asyncio.run(reset())
File "C:\Users\Adam\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\Adam\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete
return future.result()
File "D:\GPTeam\src\utils\database\reset.py", line 19, in reset
subprocess.run(["del", "-f", "database.db"])
File "C:\Users\Adam\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 503, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\Adam\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Adam\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1440, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

Got: Invalid \escape: line 3 column 9 (char 34) using Vicuna model endpoint

Both on OSX and ubuntu with the following env var OPENAI_API_BASE=https://MY_VICUNA_API_ENDPOINT/v1 running poetry run world

Welcome to Jest Jockeys! 

[Marty] Observe Observed 0 new events since 09:10:48
[Marty] React Deciding how to react to recent events...
[Rebecca] Observe Observed 0 new events since 09:10:48
[Rebecca] React Deciding how to react to recent events...
[Ricardo] Observe Observed 0 new events since 09:10:48
[Ricardo] React Deciding how to react to recent events...

Traceback (most recent call last):
  File "/usr/src/app/.venv/lib/python3.10/site-packages/langchain/output_parsers/pydantic.py", line 25, in parse
    json_object = json.loads(json_str)
  File "/usr/local/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.10/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 3 column 9 (char 34)

When logging response var from https://github.com/101dotxyz/GPTeam/blob/main/src/agent/base.py#L840 we have the following invalid JSON:

{
"reaction": "continue",
"thought\_process": "I should continue my plan because there have been no new events that would require me to change my plan.",
"new\_plan": {
"index": 1,
"description": "Participate in an improv performance at the park.",
"start\_time": "2023-03-16T16:00:00Z",
"stop\_condition": "The performance is over or I am told to stop by someone in charge.",
"max\_duration\_hrs": 2,
"location\_id": "12345678-90ab-cdef-ghij-klmnopqrstuvwxyz"
}
}

Edit: it seems not related to the invalid JSON as with GPT3.5 I see similar json output. I continue to investigate...

Edit 2: adding text = text.replace("\\", "") fixed the issue https://github.com/hwchase17/langchain/blob/v0.0.173/langchain/output_parsers/pydantic.py#L18
I don't think it have anything to do with the GPTeam project itself.

Not able to get poetry to work

I am having issues with poetry not being able to be found even though I installed it
(101-ai-py3.11) Walts-MBP:GPTeam-main waltgrace$ poetry run world
bash: poetry: command not found

Getting the Agents to use the Serp API?

I am trying to get the agents to use the Serp API that I have set up, but they keep trying to search the database for some reason. Has anyone come up with a prompt that lets them search the web instead?

TypeError: unsupported operand type(s) for |: 'type' and 'types.GenericAlias'

Hey I keep on getting this error and I'm curious if anyone would know why and how to fix it:
(learn-env) a23@23s-MacBook-Pro GPTeam-main % poetry run world --turbo
Traceback (most recent call last):
File "", line 1, in
File "/Users/a23/opt/anaconda3/envs/learn-env/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/Users/a23/Downloads/GPTeam-main/src/main.py", line 12, in
from src.utils.database.client import get_database
File "/Users/a23/Downloads/GPTeam-main/src/utils/database/client.py", line 5, in
from src.utils.database.sqlite import SqliteDatabase
File "/Users/a23/Downloads/GPTeam-main/src/utils/database/sqlite.py", line 33, in
class SqliteDatabase(DatabaseProviderSingleton):
File "/Users/a23/Downloads/GPTeam-main/src/utils/database/sqlite.py", line 121, in SqliteDatabase
self, table: Tables, data: dict | list[dict], upsert=False
TypeError: unsupported operand type(s) for |: 'type' and 'types.GenericAlias'
(learn-env) a23@23s-MacBook-Pro GPTeam-main %

Can we add chat via Discord?

Is it possible for me to input text into channels and direct workflow?
I want to reply in a thread and have the agents react to my input for suggestions

How do you even use this?

How do i setup the agents properly, what are these locations, and what the heck is this improv thing? I know i am new, but can you please give a more detailed explanation on how to actually setup the agents with different prompts/roles? Do i have to edit the config file directly and rewrite it every time?

Error with channel_id

Traceback (most recent call last):
  File "/Users/mhall/personal/GPTeam/src/main.py", line 37, in run_world
    world = await World.from_id(worlds[-1]["id"])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mhall/personal/GPTeam/src/world/base.py", line 72, in from_id
    locations = [Location(**location) for location in locations]
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mhall/personal/GPTeam/src/world/base.py", line 72, in <listcomp>
    locations = [Location(**location) for location in locations]
                 ^^^^^^^^^^^^^^^^^^^^
  File "/Users/mhall/personal/GPTeam/src/location/base.py", line 50, in __init__
    super().__init__(
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for Location
channel_id
  value is not a valid integer (type=type_error.integer)

When using my OpenAI key and nothing else.

Python 3.11.

Channel IDs should be Optional, but for some reason Pydantic thinks int is required

Changes in config.json not updated after `poetry run db-reset`

Thanks for creating the repo! I see great potential in the project.

I edited the config.json file to reflect new locations and agents, which were correctly initialized on the first run. However, when I edit the config.json after the first run (e.g., change agent's initial locations), these changes are not updated into the world when I subsequently execute poetry run db-reset followed by poetry run world.

I've tried deleting cache.json, database.db, and vectors.pickle.gz files, but the old locations persist when I run poetry run world.

How can I fully reset the world to pick up changes in config.json file?

RateLimitError

I am getting this error frequently. I'm not at my ratelimit according to my dashboard, so not sure if it is something else? I see backoff is already implemented, so not sure what this could be:

Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.._completion_with_retry in 1.0 seconds as it raised RateLimitError: That model is currently overloaded with other requests.

my agents get stuck after a few minutes.

Anyone facing this issue?

error trace for reference

Exception ignored in: <coroutine object ChatOpenAI._agenerate at 0x12e499340>
Traceback (most recent call last):
  File "/path_to_your_env/lib/python3.11/site-packages/langchain/chat_models/openai.py", line 318, in _agenerate
    response = await acompletion_with_retry(
  File "/path_to_your_env/lib/python3.11/site-packages/langchain/chat_models/openai.py", line 63, in acompletion_with_retry
    return await _completion_with_retry(**kwargs)
  File "/path_to_your_env/lib/python3.11/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped
    return await fn(*args, **kwargs)
  File "/path_to_your_env/lib/python3.11/site-packages/tenacity/_asyncio.py", line 47, in __call__
    do = self.iter(retry_state=retry_state)
  File "/path_to_your_env/lib/python3.11/site-packages/tenacity/__init__.py", line 314, in iter
    return fut.result()
  File "/path_to_python_installation/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
  File "/path_to_python_installation/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/path_to_your_env/lib/python3.11/site-packages/tenacity/_asyncio.py", line 50, in __call__
    result = await fn(*args, **kwargs)
  File "/path_to_your_env/lib/python3.11/site-packages/langchain/chat_models/openai.py", line 61, in _completion_with_retry
    return await llm.client.acreate(**kwargs)
  File "/path_to_your_env/lib/python3.11/site-packages/openai/api_resources/chat_completion.py", line 45, in acreate
    return await super().acreate(*args, **kwargs)
  File "/path_to_your_env/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 217, in acreate
    response, _, api_key = await requestor.arequest(
RuntimeError: coroutine ignored GeneratorExit

setup.py fails when run inside a conda env

I set up a conda env running python 3.9 to work on GPTeam, once I activated it and ran the setup command I received the following error. The setup command worked normally after I deactivated the env, but it might be better to have it hosted in an environment to isolate it from any other dependencies I have locally.

Traceback (most recent call last):
  File "/Users/mohayat/projects/GPTeam/setup.py", line 66, in <module>
    subprocess.run(["poetry", "run", "db-reset"], check=True)
  File "/Users/mohayat/anaconda3/envs/gpteam/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['poetry', 'run', 'db-reset']' returned non-zero exit status 1.```

Improve response formatting for SearchDocumentsTool

I have my team chatting away (a mixture of amusement and wonderment!) and have a few errors in the terminal window. Not a good enough coder to fix them, but posting here if anyone else has them and/or wants to fix or advise:

Error: 1 validation error for SearchDocumentsToolInput
query
field required (type=value_error.missing)

Consult_directory does not provide location of the agents, while the tool description says it does

It seems this tool was refactored, but now causes issues because the location is not provided (whereas the description says it does): The agents don't know where to go, and often get stuck in "waiting for events" mode.

def consult_directory(
    tool_context: ToolContext,
    agent_input: str = None,
):
    """Shows a list of all agents and their current locations"""

    # first, craft the event object
    agents = tool_context.context.agents

    directory = ""

    for index, agent in enumerate(agents):
        if agent["id"] == tool_context.agent_id:
            continue

        directory += (
            f"{agent['full_name']}\n"
            f"---------------------\n"
            f"Bio: {agent['public_bio']}\n"
            f"---------------------\n\n"
        )

    return directory

Installation

Having trouble installing this on a linux operating system, and having trouble creating a .env file... any reccomendations??

Using GPTeam with gpt4all or llama-cpp-python openai-compatible API endpoint

Hi!

I got GPTeam to connect to the GPT4all local chat server mode by hacking the openai.api_base url to point at the localhost API endpoint provided by GPT4all, as per https://docs.gpt4all.io/gpt4all_chat.html#gpt4all-chat-server-mode

I also had to hack all of the constructors of ChatModel() in src/agent/base.py to specify a large request_timeout value (otherwise the local model kept hitting request timeouts).

This seems to be almost working. In the GPT4all server window, I can see the requests coming in, but the agents are not generating responses or making progress. (I tried both the MPT-7b-Chat and MPT-7b-Instruct models).

I think getting this working would be a very fun use case of this tool, as it does not require OpenAI in the loop. I would be quite satisfied even if this means it takes quite a while to wait for the scenario to run.

Is this some limitation of the API exposed by GPT4all? I can provide a branch with my hacks, if that helps make progress. The GPT4all project is quite active; if we can point out why their API is incomplete, they will probably patch it for us.

LLMSinglePlan object has no attribute "related_messages"

I've spun up my world using poetry run world --turbo and after letting the world run for a while all agents seem to stop and I get this error message:

Traceback (most recent call last):
  File "/Users/mohayat/projects/GPTeam/src/main.py", line 46, in run_world_async
    await world.run()
  File "/Users/mohayat/projects/GPTeam/src/world/base.py", line 113, in run
    await asyncio.gather(*tasks)
  File "/Users/mohayat/projects/GPTeam/src/world/base.py", line 101, in run_agent_loop
    await self.run_next_agent()
  File "/Users/mohayat/projects/GPTeam/src/world/base.py", line 96, in run_next_agent
    await agent.run_for_one_step()
  File "/Users/mohayat/projects/GPTeam/src/agent/base.py", line 1072, in run_for_one_step
    await self._do_first_plan()
  File "/Users/mohayat/projects/GPTeam/src/agent/base.py", line 973, in _do_first_plan
    await self._act(current_plan)
  File "/Users/mohayat/projects/GPTeam/src/agent/base.py", line 876, in _act
    if plan.related_message
                ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'LLMSinglePlan' object has no attribute 'related_message'

I've tried making my changes locally but it keeps running into the same issue. Any advice?

Agent to agent messages can be addressed X in Y

pattern = r"(?P<sender>[\w\s]+) said to (?P<recipient>[\w\s]+): [\"'](?P<message>.*)[\"']"

I've got messages which are addressed to "everyone in location", which breaks this regex, as it doesn't expect recipient to have whitespace in it. This causes the sender_name, recipient, content = re.findall(pattern, event.description)[0] to explode

Adding .* to the regex to allow the recipient to have spaces in it makes it work, though I'm not sure it wont break something else

With the .* added: pattern = r"(?P<sender>[\w\s]+) said to (?P<recipient>[\w\s]+.*): [\"'](?P<message>.*)[\"']"

Getting API Connection error

Hi there

I've followed the instructions on my mac to install gpteams and entered by OPENAI API key into the .env file but when running poetry run world I'm just getting this error:

Retrying langchain.chat_models.openai.acompletion_with_retry.._completion_with_retry in 1.0 seconds as it raised APIConnectionError: Error communicating with OpenAI.

'poetry: command not found' after successful setup

  1. Cloned repository to my user folder on M1 Mac.
  2. Navigated to the new directory ~/gpteam
  3. Ran setup.py. Installs poetry with no errors.
  4. Put my API key into .env
  5. poetry run world returns command not found
(base) Mac-Studio-6:~ USERNAME$ cd ~/gpteam
(base) Mac-Studio-6:gpteam USERNAME$ python setup.py
⚠️ Poetry not found. Would you like to install it now? (y/n): y
Installing Poetry…
Retrieving Poetry metadata

The latest version (1.4.2) is already installed.
Installing dependencies…
Installing dependencies from lock file

No dependencies to install or update

Installing the current project: 101-ai (0.1.0)
Seed the database…
database reset
seeding the db - normal

Setup complete!

-> You are ready to run the world. Please set your OPENAI_API_KEY in .env and run `poetry run world` to get started.
(base) Mac-Studio-6:gpteam USERNAME$ poetry run world
-bash: poetry: command not found

Python 3.10.6

Thanks!

setup can only be run by python 3.10 or newer

Using Python 3.9.12 resulted in the following error (here is an useful discussion https://bugs.python.org/issue42233):

Installing the current project: 101-ai (0.1.0)
Seed the database...
Traceback (most recent call last):
File "", line 1, in
File "/Users/alberty/miniforge3/envs/gpteam/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/Users/alberty/Desktop/research/GPTeam/src/utils/database/reset.py", line 8, in
from .seed import seed
File "/Users/alberty/Desktop/research/GPTeam/src/utils/database/seed.py", line 6, in
from src.utils.database.client import get_database
File "/Users/alberty/Desktop/research/GPTeam/src/utils/database/client.py", line 5, in
from src.utils.database.sqlite import SqliteDatabase
File "/Users/alberty/Desktop/research/GPTeam/src/utils/database/sqlite.py", line 33, in
class SqliteDatabase(DatabaseProviderSingleton):
File "/Users/alberty/Desktop/research/GPTeam/src/utils/database/sqlite.py", line 121, in SqliteDatabase
self, table: Tables, data: dict | list[dict], upsert=False
TypeError: unsupported operand type(s) for |: 'type' and 'types.GenericAlias'
Traceback (most recent call last):
File "/Users/alberty/Desktop/research/GPTeam/setup.py", line 66, in
subprocess.run(["poetry", "run", "db-reset"], check=True)
File "/Users/alberty/miniforge3/envs/gpteam/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['poetry', 'run', 'db-reset']' returned non-zero exit status 1.

Graphical interface

Would be great to see 3d or 2d world where you can see the movement of the Characters. Might be kind of game or world simulation.

'LLMSinglePlan' object has no attribute 'related_message'

I ran into this error:

[Rebecca] Act Starting to act on plan.
[Marty] Act Starting to act on plan.
[Ricardo] Observe Observed 0 new events since 22:43:22
[Rebecca] Observe Observed 1 new events since 22:43:12
[Marty] Observe Observed 0 new events since 22:43:25
Traceback (most recent call last):
  File "/usr/local/google/home/ilmo/Downloads/GPTeam/src/main.py", line 46, in run_world_async
    await world.run()
  File "/usr/local/google/home/ilmo/Downloads/GPTeam/src/world/base.py", line 113, in run
    await asyncio.gather(*tasks)
  File "/usr/local/google/home/ilmo/Downloads/GPTeam/src/world/base.py", line 101, in run_agent_loop
    await self.run_next_agent()
  File "/usr/local/google/home/ilmo/Downloads/GPTeam/src/world/base.py", line 96, in run_next_agent
    await agent.run_for_one_step()
  File "/usr/local/google/home/ilmo/Downloads/GPTeam/src/agent/base.py", line 1075, in run_for_one_step
    await self._do_first_plan()
  File "/usr/local/google/home/ilmo/Downloads/GPTeam/src/agent/base.py", line 976, in _do_first_plan
    await self._act(current_plan)
  File "/usr/local/google/home/ilmo/Downloads/GPTeam/src/agent/base.py", line 874, in _act
    if (plan.related_message):
AttributeError: 'LLMSinglePlan' object has no attribute 'related_message'

I believe changing src/agent/base.py (at line 873) will fix it:

        # Gather relevant memories
        try:
            memory_query = plan.related_message.get_event_message()
        except AttributeError:
            memory_query = plan.description
        	
        relevant_memories = await get_relevant_memories(
            memory_query,
            memories=self.memories,
            k=20,
        )

Discord bots are offline, parsing errors

I've set up the Discord server. When I run the world, I see some activity, movement between rooms, and once or twice a message was posted, but all the bots statuses remain offline.

Then soon I get some parsing errors and everything stops.

[Calvin] Moved Location Break Room -> Conference Room @ 05:05:45
[Rebecca] Observed 0 new events Last checked events at 04:59:08
[Ricardo] Observed 0 new events Last checked events at 04:50:53
[Jacquelin] Observed 0 new events Last checked events at 04:35:58
Traceback (most recent call last):
  File "/Users/toddsmith/.virtualenvs/GPTeam/lib/python3.10/site-packages/langchain/output_parsers/pydantic.py", line 25, in parse
    json_object = json.loads(json_str)
  File "/usr/local/Cellar/[email protected]/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/[email protected]/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/[email protected]/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/toddsmith/PycharmProjects/GPTeam/src/main.py", line 45, in run_world
    await world.run()
  File "/Users/toddsmith/PycharmProjects/GPTeam/src/world/base.py", line 113, in run
    await asyncio.gather(*tasks)
  File "/Users/toddsmith/PycharmProjects/GPTeam/src/world/base.py", line 101, in run_agent_loop
    await self.run_next_agent()
  File "/Users/toddsmith/PycharmProjects/GPTeam/src/world/base.py", line 96, in run_next_agent
    await agent.run_for_one_step()
  File "/Users/toddsmith/PycharmProjects/GPTeam/src/agent/base.py", line 1135, in run_for_one_step
    self.react_response = await self._react(events)
  File "/Users/toddsmith/PycharmProjects/GPTeam/src/agent/base.py", line 910, in _react
    parsed_reaction_response: LLMReactionResponse = reaction_parser.parse(response)
  File "/Users/toddsmith/.virtualenvs/GPTeam/lib/python3.10/site-packages/langchain/output_parsers/fix.py", line 38, in parse
    parsed_completion = self.parser.parse(new_completion)
  File "/Users/toddsmith/.virtualenvs/GPTeam/lib/python3.10/site-packages/langchain/output_parsers/pydantic.py", line 31, in parse
    raise OutputParserException(msg)
langchain.schema.OutputParserException: Failed to parse LLMReactionResponse from completion postpone

sqlite3.ProgrammingError: Cannot operate on a closed database.

Any one got fixes for it ?
`Traceback (most recent call last):
File "C:\Users\Autogpt\Desktop\GPTeam-2nd.venv\Lib\site-packages\langchain\output_parsers\pydantic.py", line 26, in parse
return self.pydantic_object.parse_obj(json_object)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pydantic\main.py", line 526, in pydantic.main.BaseModel.parse_obj
File "pydantic\main.py", line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 6 validation errors for LLMReactionResponse
new_plan -> index
field required (type=value_error.missing)
new_plan -> description
field required (type=value_error.missing)
new_plan -> start_time
field required (type=value_error.missing)
new_plan -> stop_condition
field required (type=value_error.missing)
new_plan -> max_duration_hrs
field required (type=value_error.missing)
new_plan -> location_name
field required (type=value_error.missing)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Autogpt\Desktop\GPTeam-2nd.venv\Lib\site-packages\langchain\output_parsers\fix.py", line 31, in parse
parsed_completion = self.parser.parse(completion)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Autogpt\Desktop\GPTeam-2nd.venv\Lib\site-packages\langchain\output_parsers\pydantic.py", line 31, in parse
raise OutputParserException(msg)
langchain.schema.OutputParserException: Failed to parse LLMReactionResponse from completion {
"reaction": "continue",
"thought_process": "Since my current plan is to compile a comprehensive research report on cryptocurrencies, and there haven't been any new events that require immediate attention, I should continue with my plan.
I will proceed with gathering information and insights from my colleagues to ensure a thorough analysis of market trends, potential growth, risks, and the regulatory landscape of each cryptocurrency.",
"new_plan": {}
}. Got: 6 validation errors for LLMReactionResponse
new_plan -> index
field required (type=value_error.missing)
new_plan -> description
field required (type=value_error.missing)
new_plan -> start_time
field required (type=value_error.missing)
new_plan -> stop_condition
field required (type=value_error.missing)
new_plan -> max_duration_hrs
field required (type=value_error.missing)
new_plan -> location_name
field required (type=value_error.missing)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Autogpt\Desktop\GPTeam-2nd.venv\Lib\site-packages\langchain\output_parsers\pydantic.py", line 26, in parse
return self.pydantic_object.parse_obj(json_object)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pydantic\main.py", line 526, in pydantic.main.BaseModel.parse_obj
File "pydantic\main.py", line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 6 validation errors for LLMReactionResponse
new_plan -> index
field required (type=value_error.missing)
new_plan -> description
field required (type=value_error.missing)
new_plan -> start_time
field required (type=value_error.missing)
new_plan -> stop_condition
field required (type=value_error.missing)
new_plan -> max_duration_hrs
field required (type=value_error.missing)
new_plan -> location_name
field required (type=value_error.missing)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\main.py", line 47, in run_world_async
await world.run()
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\world\base.py", line 113, in run
await asyncio.gather(*tasks)
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\world\base.py", line 101, in run_agent_loop
await self.run_next_agent()
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\world\base.py", line 96, in run_next_agent
await agent.run_for_one_step()
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\agent\base.py", line 1061, in run_for_one_step
self.react_response = await self._react(events)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\agent\base.py", line 846, in _react
parsed_reaction_response: LLMReactionResponse = reaction_parser.parse(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Autogpt\Desktop\GPTeam-2nd.venv\Lib\site-packages\langchain\output_parsers\fix.py", line 38, in parse
parsed_completion = self.parser.parse(new_completion)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Autogpt\Desktop\GPTeam-2nd.venv\Lib\site-packages\langchain\output_parsers\pydantic.py", line 31, in parse
raise OutputParserException(msg)
langchain.schema.OutputParserException: Failed to parse LLMReactionResponse from completion {
"reaction": "continue",
"thought_process": "I should continue with my current plan because there haven't been any new developments that require a change in strategy. I will proceed with my tasks and monitor the situation for any updates.",
"new_plan": {}
}. Got: 6 validation errors for LLMReactionResponse
new_plan -> index
field required (type=value_error.missing)
new_plan -> description
field required (type=value_error.missing)
new_plan -> start_time
field required (type=value_error.missing)
new_plan -> stop_condition
field required (type=value_error.missing)
new_plan -> max_duration_hrs
field required (type=value_error.missing)
new_plan -> location_name
field required (type=value_error.missing)

Exception ignored in: <coroutine object World.run_agent_loop at 0x000002026C019FC0>
Traceback (most recent call last):
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\world\base.py", line 101, in run_agent_loop
await self.run_next_agent()
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\world\base.py", line 96, in run_next_agent
await agent.run_for_one_step()
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\agent\base.py", line 1053, in run_for_one_step
events = await self.observe()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\agent\base.py", line 983, in observe
(events, _) = await self.context.events_manager.get_events(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\event\base.py", line 234, in get_events
await self.refresh_events()
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\event\base.py", line 190, in refresh_events
async with self.refresh_lock:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\asyncio\locks.py", line 21, in aexit
self.release()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\asyncio\locks.py", line 138, in release
self._wake_up_first()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\asyncio\locks.py", line 155, in _wake_up_first
fut.set_result(True)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 761, in call_soon
self._check_closed()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 519, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <coroutine object World.run_agent_loop at 0x000002026C01A2C0>
Traceback (most recent call last):
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\world\base.py", line 101, in run_agent_loop
await self.run_next_agent()
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\world\base.py", line 96, in run_next_agent
await agent.run_for_one_step()
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\agent\base.py", line 1077, in run_for_one_step
if await self._should_reflect():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\agent\base.py", line 372, in _should_reflect
data = await (await get_database()).get_should_reflect(str(self.id))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Autogpt\Desktop\GPTeam-2nd\src\utils\database\sqlite.py", line 97, in get_should_reflect
async with self.client.execute(
File "C:\Users\Autogpt\Desktop\GPTeam-2nd.venv\Lib\site-packages\aiosqlite\context.py", line 44, in aexit
await self._obj.close()
File "C:\Users\Autogpt\Desktop\GPTeam-2nd.venv\Lib\site-packages\aiosqlite\cursor.py", line 80, in close
await self._execute(self._cursor.close)
File "C:\Users\Autogpt\Desktop\GPTeam-2nd.venv\Lib\site-packages\aiosqlite\cursor.py", line 40, in _execute
return await self._conn._execute(fn, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Autogpt\Desktop\GPTeam-2nd.venv\Lib\site-packages\aiosqlite\core.py", line 126, in _execute
raise ValueError("Connection closed")
ValueError: Connection closed
Future exception was never retrieved
future: <Future finished exception=ProgrammingError('Cannot operate on a closed database.')>
Traceback (most recent call last):
File "C:\Users\Autogpt\Desktop\GPTeam-2nd.venv\Lib\site-packages\aiosqlite\core.py", line 106, in run
result = function()
^^^^^^^^^^
sqlite3.ProgrammingError: Cannot operate on a closed database.
Future exception was never retrieved
future: <Future finished exception=ProgrammingError('Cannot operate on a closed database.')>
Traceback (most recent call last):
File "C:\Users\Autogpt\Desktop\GPTeam-2nd.venv\Lib\site-packages\aiosqlite\core.py", line 106, in run
result = function()
^^^^^^^^^^
sqlite3.ProgrammingError: Cannot operate on a closed database.
Future exception was never retrieved
future: <Future finished exception=ProgrammingError('Cannot operate on a closed database.')>
Traceback (most recent call last):
File "C:\Users\Autogpt\Desktop\GPTeam-2nd.venv\Lib\site-packages\aiosqlite\core.py", line 106, in run
result = function()
^^^^^^^^^^
sqlite3.ProgrammingError: Cannot operate on a closed database.`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.