Skip to content
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

[Bug] #487

Open
dhan-kum opened this issue Apr 25, 2024 · 0 comments
Open

[Bug] #487

dhan-kum opened this issue Apr 25, 2024 · 0 comments

Comments

@dhan-kum
Copy link

Describe the bug

Devika is throwing error if multiple requests are being raised in the same project. Even for simple prompt it is not giving response. I am using Gemini Pro.

How To Reproduce

Steps to reproduce the behavior (example):
1 As first question How many even numbers in 100? --- For this has given me a python program which is okay.
2. Now asking second question -- how many weeks are in August 2024.
It fails to answer and throws error

Expected behavior

Ideally, it should have responded with proper program or answer

Screenshots and logs

must share logs from frontend or backend. also If applicable, add screenshots to help explain your problem.
image
Model: gemini-pro, Enum: GOOGLE
24.04.25 17:32:11: root: DEBUG : Response (<src.llm.gemini_client.Gemini object at 0x000001D9190A6930>): --> ```
{
"action": "patch",
"response": "I encountered an error while running the project. Seems to be the code I wrote has some issues. Let me try fixing it."
}

24.04.25 17:32:11: root: INFO   : SOCKET tokens MESSAGE: {'token_usage': 740}
{
  "action": "patch",
  "response": "I encountered an error while running the project. Seems to be the code I wrote has some issues. Let me try fixing it."
}
{'action': 'patch', 'response': 'I encountered an error while running the project. Seems to be the code I wrote has some issues. Let me try fixing it.'}
24.04.25 17:32:11: root: INFO   : SOCKET server-message MESSAGE: {'messages': {'from_devika': True, 'message': 'I encountered an error while running the project. Seems to be the code I wrote has some issues. Let me try fixing it.', 'timestamp': '2024-04-25 17:32:11'}}
24.04.25 17:32:11: root: INFO   : SOCKET tokens MESSAGE: {'token_usage': 1921}
Model: gemini-pro, Enum: GOOGLE
24.04.25 17:32:17: root: DEBUG  : Response (<src.llm.gemini_client.Gemini object at 0x000001D919201820>): --> ~~~
File: `main.py`:
```py
from datetime import datetime

month = 'Aug'
year = 2024

# Get the number of days in the month
days_in_month = datetime(year, datetime.datetime.strptime(month, '%b').month, 1).daysinmonth

# Calculate the number of weeks (rounding up)
weeks_in_month = (days_in_month // 7) + 1

# Print the number of weeks
print("The number of weeks in", month, year, "is", weeks_in_month)
24.04.25 17:32:17: root: INFO   : SOCKET tokens MESSAGE: {'token_usage': 1547}
Exception in thread Thread-24 (<lambda>):
Traceback (most recent call last):
  File "C:\Python312\Lib\threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "C:\Python312\Lib\threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Work\Mo4D\Devika\devika\devika.py", line 92, in <lambda>
    thread = Thread(target=lambda: agent.subsequent_execute(message, project_name))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Work\Mo4D\Devika\devika\src\agents\agent.py", line 208, in subsequent_execute
    self.runner.execute(
  File "C:\Work\Mo4D\Devika\devika\src\agents\runner\runner.py", line 247, in execute
    self.run_code(
  File "C:\Work\Mo4D\Devika\devika\src\agents\runner\runner.py", line 191, in run_code
    code = Patcher(base_model=self.base_model).execute(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Work\Mo4D\Devika\devika\src\agents\patcher\patcher.py", line 133, in execute
    self.emulate_code_writing(valid_response, project_name)
  File "C:\Work\Mo4D\Devika\devika\src\agents\patcher\patcher.py", line 92, in emulate_code_writing
    code = file["code"]
           ~~~~^^^^^^^^
TypeError: string indices must be integers, not 'str'

### Configuration
```
- OS: [e.g. Windows, Linux, MacOS]
- Python version: [e.g. 3.10]
- Node version: [e.g. 18.0.0]
- bun version: [e.g. 0.1.0]
- search engine: [e.g. google]
- Model: [e.g. Gemini]
```

#### Additional context
Add any other context about the problem here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant