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

Supercoder Improve tool addition #755

Merged
merged 38 commits into from
Jul 20, 2023
Merged

Conversation

Autocop-Agent
Copy link
Contributor

@Autocop-Agent Autocop-Agent commented Jul 13, 2023

Description

1.Added functionality for improve_code generated by coding tool, so that code become more robust and large Application can be created
2. Added functionality for read file, overwrite file, get file from the resource directory

Related Issues

Solution and Design

Write the logic for the given problem

Test Plan

Run supercoder with the updated toolkit

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Docs update

Checklist

  • My pull request is atomic and focuses on a single change.
  • I have read the contributing guide and my code conforms to the guidelines.
  • I have documented my changes clearly and comprehensively.
  • I have added the required tests.

@Autocop-Agent Autocop-Agent changed the title Supercoder feature add Supercoder Improve tool addition Jul 13, 2023
Copy link
Collaborator

@luciferlinx101 luciferlinx101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also take the latest pull and try again seems some existing tests are failing

"""
# Get all file names that the CodingTool has written
file_names = self.resource_manager.get_files()
print(file_names)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use logger


class ImproveCodeSchema(BaseModel):
pass
# code_data: str = Field(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comments

# Extract the response first
response = result.get('response')
if not response:
print("REAPONSE NOT AVAILABLE")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use logger

choices = response.get('choices')
if not choices:
print("CHOICES NOT AVAILABLE")

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use logger


# Now you can safely extract the message content
improved_content = choices[0]["message"]["content"]
# improved_content = result["messages"][0]["content"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented code

Copy link
Contributor

@DMTarmey DMTarmey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chers

@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Patch coverage: 61.33% and project coverage change: +0.04 🎉

Comparison is base (c697937) 58.44% compared to head (cd398b3) 58.49%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #755      +/-   ##
==========================================
+ Coverage   58.44%   58.49%   +0.04%     
==========================================
  Files         157      158       +1     
  Lines        6332     6406      +74     
  Branches      656      664       +8     
==========================================
+ Hits         3701     3747      +46     
- Misses       2483     2507      +24     
- Partials      148      152       +4     
Impacted Files Coverage Δ
superagi/tools/code/coding_toolkit.py 0.00% <0.00%> (ø)
superagi/tools/code/write_code.py 82.45% <0.00%> (-3.00%) ⬇️
superagi/resource_manager/file_manager.py 49.39% <13.63%> (-12.90%) ⬇️
superagi/tools/code/improve_code.py 87.75% <87.75%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Fluder-Paradyne Fluder-Paradyne merged commit 9f0a78d into dev Jul 20, 2023
nihiragarwal24 pushed a commit that referenced this pull request Jul 25, 2023
luciferlinx101 added a commit that referenced this pull request Jul 25, 2023
* Fix/agents delete (#795)

* fixing the send email attachement issue

* delete run label (#796)

* fix

* fixing schedule agent run

* Updated README.md

Provided Instructions for serper.dev API key creation and configuring it in the Toolkit Page

* Update README.md

Updated Image

* Update config_template.yaml

Modified Serp Configuration for SERPER

* Twitter and Google Oauth for Web (#808)

Co-authored-by: Tarraann <jot.taran15522@gmail.com>

* Updated DB settings (#805)

* document fix (#806)

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* Bugs fixes new (#809)

* csv file fix (#810)

* ui bug bash fixes

* ui bug bash fixes

* Bugs new (#814)

* Fixes (#815)

Co-authored-by: Tarraann <jot.taran15522@gmail.com>

* ui bug bash fixes

* ui bug bash fixes

* Handling the rate limit exception

* fixed add_to_vector_store_and_create_summary (#827)

* fix 97971622 (#824)

* Llm models fix (#829)

* removed unnecessary toolkits from marketplace

* Dalle fix (#825)

* ui bug bash fixes (#839)

* Fixing twitter creds

* fixing google oauth issues

* fixing google oauth issue

* fixess

* fixess

* fixess

* fixess (#854)

* Resource duplicate fix (#803)

* Supercoder Improve tool addition (#755)

* rebased

* Read file s3 fix (#823)

* Updated

* Read from s3 works

* Read from s3 works

* Minor Updates

* Added Unit Tests

* Updated Tests

* Updated Tests

* Refactored

* Updated Test

* Updated Test

* Updated Test

* Edit agent templates fix (#838)

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* rebased

* first commit

* instagram APIs implemented and AI generated caption utility added

* Image upload to S3 and URL generation added

* added upload to s3 instagram bucket

* Refactored code

* removed jpeg files used for testing

* fixed recurring run issues

* fixed recurring issues

* Readme added

* instabot config folder deleted

* refactored code

* Handled the case where stable diffusion generated multiple photos

* docker compose.yaml version reverted to original

* removed the utility to add stable diffusion automatically

* added test cases and modified readme

* Added instagram tool bucket entry in config_template.yaml

* added instagram tool bucket entry in config template

---------

Co-authored-by: I’m <133493246+TransformerOptimus@users.noreply.github.com>
Co-authored-by: TransformerOptimus <muknrq@gmail.com>
Co-authored-by: Phoenix2809 <133874957+Phoenix2809@users.noreply.github.com>
Co-authored-by: Taran <97586318+Tarraann@users.noreply.github.com>
Co-authored-by: Tarraann <jot.taran15522@gmail.com>
Co-authored-by: luciferlinx <129729795+luciferlinx101@users.noreply.github.com>
Co-authored-by: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com>
Co-authored-by: Kalki <parth.pathak@science.christuniversity.in>
Co-authored-by: Kalki <97698934+jedan2506@users.noreply.github.com>
Co-authored-by: GeekyBaller <43145646+neelayan7@users.noreply.github.com>
Co-authored-by: Nishant Borthakur <101320057+nborthy@users.noreply.github.com>
Co-authored-by: NishantBorthakur <nist.16br@gmail.com>
Co-authored-by: Autocop-Agent <129729746+Autocop-Agent@users.noreply.github.com>
Co-authored-by: Anisha Gupta <60440541+anisha1607@users.noreply.github.com>
Co-authored-by: Maverick-F35 <maverickcode.f35@gmail.com>
luciferlinx101 added a commit that referenced this pull request Jul 27, 2023
* first commit

* instagram APIs implemented and AI generated caption utility added

* Image upload to S3 and URL generation added

* added upload to s3 instagram bucket

* fixing the send email attachement issue

* fixing schedule agent run

* Refactored code

* Resource duplicate fix (#803)

* removed jpeg files used for testing

* Dalle fix (#812)

Co-authored-by: Tarraann <jot.taran15522@gmail.com>

* fixed recurring run issues

* Supercoder Improve tool addition (#755)

* fixed recurring issues

* Edit agent templates (#793)

* Added Controller Function

* updated frontend

* made minor changes in frontend

* added unit test

* made minor changes in frontend and backend

* added another unit test

* added minor change in frontend

---------

Co-authored-by: anisha-contlo <anisha@contlo.com>

* Readme added

* instabot config folder deleted

* Read file s3 fix (#823)

* Updated

* Read from s3 works

* Read from s3 works

* Minor Updates

* Added Unit Tests

* Updated Tests

* Updated Tests

* Refactored

* Updated Test

* Updated Test

* Updated Test

* refactored code

* Handled the case where stable diffusion generated multiple photos

* ui bug bash fixes

* docker compose.yaml version reverted to original

* removed the utility to add stable diffusion automatically

* ui bug bash fixes

* ui bug bash fixes

* Edit agent templates fix (#838)

* ui bug bash fixes

* added test cases and modified readme

* Frontend bugs (#849)

* asyn function in content.js, utils refactored

* minor fixes

* prevent default centralisation

* dropdown issue fix

---------

Co-authored-by: NishantBorthakur <nist.16br@gmail.com>

* Added instagram tool bucket entry in config_template.yaml

* added instagram tool bucket entry in config template

* ui bug fixes

* ui bug fixes

* ui bug fixes

* External repo support for marketplace (#847)

* Added support for parsing marketplace repo

* Added Support for marketplace repo

* Improved Marketplace logic

* Fixed marketplace install

* Handled no path bug

* Updated .gitignore

* Updated unit test

* Added Unit Test

* Updated .gitignore

* Refactored Code

* Updated Marketplace URL

* Added Unit Tests

* Update tool_helper.py

* Update tool_helper.py

---------

Co-authored-by: I’m <133493246+TransformerOptimus@users.noreply.github.com>

* instagram image added

* apm bug fixes

* Dev rebase  (#858)

* Fix/agents delete (#795)

* fixing the send email attachement issue

* delete run label (#796)

* fix

* fixing schedule agent run

* Updated README.md

Provided Instructions for serper.dev API key creation and configuring it in the Toolkit Page

* Update README.md

Updated Image

* Update config_template.yaml

Modified Serp Configuration for SERPER

* Twitter and Google Oauth for Web (#808)

Co-authored-by: Tarraann <jot.taran15522@gmail.com>

* Updated DB settings (#805)

* document fix (#806)

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* Bugs fixes new (#809)

* csv file fix (#810)

* ui bug bash fixes

* ui bug bash fixes

* Bugs new (#814)

* Fixes (#815)

Co-authored-by: Tarraann <jot.taran15522@gmail.com>

* ui bug bash fixes

* ui bug bash fixes

* Handling the rate limit exception

* fixed add_to_vector_store_and_create_summary (#827)

* fix 97971622 (#824)

* Llm models fix (#829)

* removed unnecessary toolkits from marketplace

* Dalle fix (#825)

* ui bug bash fixes (#839)

* Fixing twitter creds

* fixing google oauth issues

* fixing google oauth issue

* fixess

* fixess

* fixess

* fixess (#854)

* Resource duplicate fix (#803)

* Supercoder Improve tool addition (#755)

* rebased

* Read file s3 fix (#823)

* Updated

* Read from s3 works

* Read from s3 works

* Minor Updates

* Added Unit Tests

* Updated Tests

* Updated Tests

* Refactored

* Updated Test

* Updated Test

* Updated Test

* Edit agent templates fix (#838)

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* rebased

* first commit

* instagram APIs implemented and AI generated caption utility added

* Image upload to S3 and URL generation added

* added upload to s3 instagram bucket

* Refactored code

* removed jpeg files used for testing

* fixed recurring run issues

* fixed recurring issues

* Readme added

* instabot config folder deleted

* refactored code

* Handled the case where stable diffusion generated multiple photos

* docker compose.yaml version reverted to original

* removed the utility to add stable diffusion automatically

* added test cases and modified readme

* Added instagram tool bucket entry in config_template.yaml

* added instagram tool bucket entry in config template

---------

Co-authored-by: I’m <133493246+TransformerOptimus@users.noreply.github.com>
Co-authored-by: TransformerOptimus <muknrq@gmail.com>
Co-authored-by: Phoenix2809 <133874957+Phoenix2809@users.noreply.github.com>
Co-authored-by: Taran <97586318+Tarraann@users.noreply.github.com>
Co-authored-by: Tarraann <jot.taran15522@gmail.com>
Co-authored-by: luciferlinx <129729795+luciferlinx101@users.noreply.github.com>
Co-authored-by: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com>
Co-authored-by: Kalki <parth.pathak@science.christuniversity.in>
Co-authored-by: Kalki <97698934+jedan2506@users.noreply.github.com>
Co-authored-by: GeekyBaller <43145646+neelayan7@users.noreply.github.com>
Co-authored-by: Nishant Borthakur <101320057+nborthy@users.noreply.github.com>
Co-authored-by: NishantBorthakur <nist.16br@gmail.com>
Co-authored-by: Autocop-Agent <129729746+Autocop-Agent@users.noreply.github.com>
Co-authored-by: Anisha Gupta <60440541+anisha1607@users.noreply.github.com>
Co-authored-by: Maverick-F35 <maverickcode.f35@gmail.com>

* apm bug fixes

* Docker image (#836)

* handled resource path change (#861)

* handled resource path change

* readme changed

* added new test case for stable diffusion

* test cases refactored

* Updated Expiry Time backward fix

* readme toolkit fix (#867)

* Knowledge frontend (#860)

* knowledge first cut

* knowledge details

* knowledge add form

* agent create knowledge select

* add database part 1

* add database part 2

* local storage fixes

* database details

* minor fix

* comments resolution

* knowledge details dropdown

* knowledge form added

* delete database

* delete database modal

* delete database modal 2

* minorf ix

* marketplace for knowledge

* update database changes

* dropdown changes

* uninstall knowledge in marketplace

* minor fixes

* minor fixws

* api integration

* bug fixes on db connect

* bug fix on deleting database

* knowledge dropdown fi

* model fixes

* minor fiox

* remove tab fixes

* minor fix

* loading text fixes

* index validation

* uninstall knowledge api

* minor fix

* minor time fix

* code refactoring

* knowledge id changed to knowledge name

* introduction and use cases added

* uninstall marketplace template by id

* minor fixes

* Changes in API

* Changea

* bug fixes where adding loader while installing, icon alignment, selecting a knowledge made compulsory,
knowledge sidebar issues are fixed,
adding of loader in marketplace, connection of database, uninstalling knowledge resolved, dropdown bug by mayur resolved,
knowledge id was not going with the agent configs in, resolved it

* minor bug fixes

* adding of installed state in the cards of knowledge marketplace

* install template condtion

* merging with dev of missed part

* install dropdown bug fix

* select index validation

* delete db prompt change

* time issue fix

* connect db response handling

* minor fix

* final changes

* minor fix

---------

Co-authored-by: NishantBorthakur <nist.16br@gmail.com>
Co-authored-by: Tarraann <jot.taran15522@gmail.com>
Co-authored-by: namansleeps <mandhani12@gmail.com>

* Fixed Delete Agent Bug (#830)

* made the fix

* changed deleted status to stopped

* close button fix

* refactor

* centralise prevent default

* app.css fixes

* Dev fixes (#869)

* close button fix

* refactor

* centralise prevent default

* app.css fixes

---------

Co-authored-by: NishantBorthakur <nist.16br@gmail.com>

* close icon issue

* Added tools.json (#868)

* Updated Chat completion for tool selection prompt

* Updated Prompt

* Bug fixes afternoon (#875)

* scheduling bug fixes

* agent templates install bug fix

* Docker image (#876)

* temp commit

* use config.yaml in docker-compose.yaml

* temp commit

* temp commit

* Fix/agents delete (#795)

* fixing the send email attachement issue

* delete run label (#796)

* fix

* works with slim

* fixing schedule agent run

* Updated README.md

Provided Instructions for serper.dev API key creation and configuring it in the Toolkit Page

* optimize gui build

* only copy necessary file

* images build

* Update README.md

Updated Image

* Update config_template.yaml

Modified Serp Configuration for SERPER

* Twitter and Google Oauth for Web (#808)

Co-authored-by: Tarraann <jot.taran15522@gmail.com>

* Updated DB settings (#805)

* document fix (#806)

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* ui bug bash fixes

* Bugs fixes new (#809)

* csv file fix (#810)

* ui bug bash fixes

* build nginx

* ui bug bash fixes

* Bugs new (#814)

* Fixes (#815)

Co-authored-by: Tarraann <jot.taran15522@gmail.com>

* ui bug bash fixes

* ui bug bash fixes

* Handling the rate limit exception

* fixed add_to_vector_store_and_create_summary (#827)

* fix 97971622 (#824)

* Llm models fix (#829)

* removed unnecessary toolkits from marketplace

* revert nginx change

* docker gui for dev

* docker ignore update

* docker ignore update for gui

* Dalle fix (#825)

* bumpupto 3.10

* ui bug bash fixes (#839)

* Fixing twitter creds

* fixing google oauth issues

* fixing google oauth issue

* remove git from dependencies

* remove --only=production

* install tool dependencies on reboot

* add docker compose example to use docker images

---------

Co-authored-by: I’m <133493246+TransformerOptimus@users.noreply.github.com>
Co-authored-by: BoundlessAsura <122777244+boundless-asura@users.noreply.github.com>
Co-authored-by: TransformerOptimus <muknrq@gmail.com>
Co-authored-by: Boundless Asura <nihir@contlo.com>
Co-authored-by: Phoenix2809 <133874957+Phoenix2809@users.noreply.github.com>
Co-authored-by: Taran <97586318+Tarraann@users.noreply.github.com>
Co-authored-by: Tarraann <jot.taran15522@gmail.com>
Co-authored-by: luciferlinx <129729795+luciferlinx101@users.noreply.github.com>
Co-authored-by: Kalki <parth.pathak@science.christuniversity.in>
Co-authored-by: Kalki <97698934+jedan2506@users.noreply.github.com>
Co-authored-by: GeekyBaller <43145646+neelayan7@users.noreply.github.com>
Co-authored-by: Nishant Borthakur <101320057+nborthy@users.noreply.github.com>
Co-authored-by: NishantBorthakur <nist.16br@gmail.com>

* Final knowledge backend (#870)

* very minor fix for naming

* Changes for HTTP EXception in Knowledge Controller

* HTTP changes for vector_dbs

* Bug fixes afternoon (#878)

* scheduling bug fixes

* agent templates install bug fix

* tool templates fixes

* Refactoring of vector embedding

* adding of knowledge logo

* Delete HTTP fixed

* Updated prompt

* changes in tests

* changes

* changes

* args fix in dalle

* bug fix

* minor change

* minor changes

* fixes (#886)

* the user will now be unable to select striked knowledges

* minor fix

* Fix for agent details - not fetching data

* minor change for details

* Fixes

---------

Co-authored-by: Maverick-F35 <maverickcode.f35@gmail.com>
Co-authored-by: TransformerOptimus <muknrq@gmail.com>
Co-authored-by: Taran <97586318+Tarraann@users.noreply.github.com>
Co-authored-by: Tarraann <jot.taran15522@gmail.com>
Co-authored-by: Autocop-Agent <129729746+Autocop-Agent@users.noreply.github.com>
Co-authored-by: Anisha Gupta <60440541+anisha1607@users.noreply.github.com>
Co-authored-by: anisha-contlo <anisha@contlo.com>
Co-authored-by: Kalki <parth.pathak@science.christuniversity.in>
Co-authored-by: Nishant Borthakur <101320057+nborthy@users.noreply.github.com>
Co-authored-by: NishantBorthakur <nist.16br@gmail.com>
Co-authored-by: Maverick-F35 <138012351+Maverick-F35@users.noreply.github.com>
Co-authored-by: I’m <133493246+TransformerOptimus@users.noreply.github.com>
Co-authored-by: BoundlessAsura <122777244+boundless-asura@users.noreply.github.com>
Co-authored-by: Phoenix2809 <133874957+Phoenix2809@users.noreply.github.com>
Co-authored-by: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com>
Co-authored-by: Kalki <97698934+jedan2506@users.noreply.github.com>
Co-authored-by: GeekyBaller <43145646+neelayan7@users.noreply.github.com>
Co-authored-by: namansleeps <mandhani12@gmail.com>
Co-authored-by: Boundless Asura <nihir@contlo.com>
Co-authored-by: namansleeps <122260931+namansleeps@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

6 participants