- feat(server): Initial draft of OAuth init and exchange endpoints
- Add `supabase` dependency
- Add Supabase credentials to `Secrets`
- Add `get_supabase` utility to `.server.utils`
- Add `.server.integrations` API segment with initial implementations for OAuth init and exchange endpoints
- Move integration OAuth handlers to `autogpt_server.integrations.oauth`
- Change constructor of `SupabaseIntegrationCredentialsStore` to take a Supabase client
- Fix type issues in `GoogleOAuthHandler`
* feat(builder): Add skeleton loading components for Monitor views
Introduce skeleton components for Agents, Flow Runs List, and Flow Runs Status sections to enhance loading state indication. These components help improve user experience by visually outlining content placeholders while data is being fetched.
* feat(builder): Leveraging NextJS's error boundary with error.tsx
Replace the basic error page with a more detailed and interactive error component. The new component includes a retry option, a link to the homepage, and logs the error details to the console. It also aligns with NextJS standards
---------
- Make process/service startup/shutdown messages consistent
- Configure `uvicorn` to use our logging config instead of its own
- Replace `print(..)` statements in ws_api.py with log statements
- Improve log statements in ws_api.py
- Handle JSON-encoding inside `.data.execution.upsert_execution_output(..)` to ensure it is always encoded the same
- Amend `.executor.manager.execute_node(..)` to pass unencoded data into `upsert_execution_output(..)`
- Add SIGTERM handler and `cleanup()` hook to `AppProcess`
- Implement `cleanup()` on `AppService` to close DB and Redis connections
- Implement `cleanup()` on `ExecutionManager` to shut down worker pool
- Add `atexit` and SIGTERM handlers to node executor to close DB connection and shut down node workers
- Improve logging in `.executor.manager`
- Fix shutdown order of `.util.test:SpinTestServer`
- feat(builder): Add "Stop Run" buttons to monitor and builder
- Implement additional state management in `useAgentGraph` hook
- Add "stop" request mechanism
- Implement execution status tracking using WebSockets
- Add `isSaving`, `isRunning`, `isStopping` outputs
- Add `requestStopRun` method
- Rename `requestSaveRun` to `requestSaveAndRun` for clarity
- Add needed functionality for the above to `AutoGPTServerAPI` client
- Add `stopGraphExecution` method
- Add support for multiple handlers per WebSocket method
- Fix parsing of timestamps in `execution_event` WebSocket messages
- Add `IconSquare` from Lucide to `@/components/ui/icons`
- feat(server): Add `POST /graphs/{graph_id}/executions/{graph_exec_id}/stop` route
- Add `stop_graph_run` method to `AgentServer`
- feat(server): Add `cancel_execution` method to `ExecutionManager`
- Replace node executor `ProcessPoolExecutor` by `multiprocessing.Pool` (which has a `terminate()` method)
- Remove now unnecessary `Executor.wait_future(..)` method
- Add `get_graph_execution(..)` in `.data.execution`
- fix(server): Reduce number of node executors to 5 per graph executor
This is necessary because `multiprocessing.Pool` spawns its workers on init, instead of based on demand like `ProcessPoolExecutor` does
- dx(server): Improve debug logging in `ExecutionManager`
- ci(server): Add debug logging mode to CI Pytest step
### Other improvements
Server:
- Improve output type of `ExecutionManager.add_execution(..)`
- Renamed a few things in `.server.rest_api` for consistency
Front end:
- Improved typing in `AutoGPTServerAPI` client
In `autogpt_server.util.lock:KeyedMutex`:
- track number of pending requests for each lock
- only remove a lock from `self.locks` when the number of pending lock requests hits 0
* move migrations, update networking and dockignore
* update docs
* remove sqlite from ci
* remove schema linting checks
* fix formatting
* remove schema linting
* add test script
* formatting and linting
* stop pg not down
* seperate test db
* diff port
* remove duplicate
### **User description**
### Background
The scope of this change is collecting the required information that will be needed for the execution analytics.
### Changes 🏗️
* Add sentry integration.
* Refactor logging_metadata on manager.py.
* Collect graph-level & node-level instrumentation.
* Introduced `stats` column for `AgentNodeExecution` & `AgentGraphExecution`.
- Add `advanced` to `SchemaField` and pass it to `json_extra`
- Add `advanced` to `BlockIOSubSchemaMeta` type
- Update `CustomNode`, so that:
- non-required advanced inputs are hidden
- non-advanced and required inputs are always shown
- Add minimize/maximize button in the corner of modal to make it significantly larger and centered
- Add copy button to copy all text
- Add optional `title` to display as a modal header
- fix type propagation by `AppService.run_and_wait(..)`
- fix type propagation by `@expose` and add note
- fix type propagation by `wait(..)` in `.executor.manager.execute_node(..)`
- fix type propagation by `wait(..)` in `.executor.manager._enqueue_next_nodes(..)`
- remove unnecessary null checks for `.data.graph.get_node(..)`
- fix type issue in `ExecutionScheduler`
- reduce use of `# type: ignore` in `.data.execution`
- reduce usage of `# type: ignore` in `.executor.manager`
- reduce usage of `# type: ignore` in `.server`
- reduce usage of `# type: ignore` in cli.py
- update `pyright` to v1.1.378
* standalone websocket server
* add websocket url
* wip: talk to ws directly
* rename to api server
* dockerfile and queue
* fix paths
* update poetry lock
* helm charts for websockets
* create seperate deployments for websockets and rest server with redis queue for async comms
* delete duplicate queue
* add depends in ws_api
* singleton for conn manager
* update from review
* fix CI
* address feedback
* update readme
* update docker file and add migration step in readm
* ad watch
* add step to copy example env file
* put connect back in
- Update styling and use tailwind more
- Add `react-toast` dependency
- Fix output button not changing checked state on execution
- Make status a badge in node's corner
- Rename `output_data` to `executionResults` and store multiple results with execution UUIDs
- Add `DataTable` component that displays execution outputs
- Outputs can be copied and there's a toast displayed as a feedback
Issue 1:
Input text field cursor keeps moving to the end of the text.
Try to type "Hello World!" into the input text. Then try to type "some string" in the middle of the "Hello" and "World".
Issue 2:
History should only tracks on the input box onBlur/onLeave
Try to type a "longcharacters" and try to undo it, the undo is removing 1 character at a time, polluting the history, and make the undo pretty much unusable.
Issue 3:
KeyValue & ArrayInput is non-undoable.
Try to add key-value or add an entry to the list, it doesn't undo the value, but you need to click as many number of entries being added to make the undo work again
* Feat(Builder): Add first guide tutorial
* added more steps + some fixes
* added local storage to fix starting every time going to build
* update copy & paste to support mac
* small fix
* Prettier fixes
* Added "Skip Tutorial" button to first step
* some fixes based on requests
* revert camelCase change
* add ability to use url to reset tutorial
* prettier
* Added Tutorial button next to tally
* prettier
* change pinBlocksPopover to setPinBlocksPopover
* fixes + update + prettier
* made the resetTutorial url dynamic
* force to /build on reset tutorial
* fix renaming
* prettier
Update ReactFlow to version 12 and split `Flow.tsx` into `useAgentGraph` hook that takes care of agent state and API calls to the server.
- Update ReactFlow to v12 ([migration guide](https://reactflow.dev/learn/troubleshooting/migrate-to-v12))
- Move `setIsAnyModalOpen` to `FlowContext`
- Make `setHardcodedValues` and `setErrors` functions of `CustomNode` and utilize new `updateNodeData` ReactFlow API
- Fix type errors
- `useAgentGraph` hook
- Take care of all API calls, websocket, agent state and logic
- Make saving and execution async and thus more consistent and reliable
- Save&run requests are state
- Wait for node ids to sync with backend reactively
- Queue execution updates
- Memoize functions using `useCallback`
### Background
Currently, there is no way to construct the output of nodes into a composite data structure (list/dict/object) using the builder UI.
The backend already supports this feature by connecting the output pin to the input pin using these format:
* <pin_name>_$_<list_index> for constructing list
* <pin_name>_#_<dict_key> for constructing dict
* <pin_name>_@_<field_name> for constructing object
The scope of this PR is implementing the UX for this in the builder UI.
### Changes 🏗️
<img width="765" alt="image" src="https://github.com/user-attachments/assets/8fc319a4-1350-410f-98cf-24f2aa2bc34b">
This allows you to add more pins in a key value & list input: `_$_` list constructor & `_#_` dict constructor.
### Background
Boolean without default value is a UX problem. It's currently displayed as a toggle and it has no way to describe the `null` value.
So we need to prevent blocks from introducing a nullable boolean.
### Changes 🏗️
Add explicit check to prevent nullable boolean. Fix existing block field that has nullable boolean.
* talking head
* linting
* remove clip id, not needed
* add more descriptive name
* add min requirement to polling attempts and intervals
* add docs and link to docs
* remove extra space
* force new tab
* fix linting
* add did key to .env.template
### Background
We don't have an ordering guarantee on the node execution.
Let's say we have a node that has to execute different data A, B, and C.
The current implementation limits the execution to 1 execution at a time, but there is no guarantee that A, B, and C will be executed in order.
The initial implementation did not have any restrictions, so it used to be A, B, and C executed in parallel
In the current implementation with the per-node constraint, it's A, B, C are executed serially but with no guarantee of ordering.
The scope of this PR is to guarantee that order.
### Changes 🏗️
Guaranteeing the execution per node ordering by avoiding any re-enqueue mechanism. If there are two executions run in the same node, the first one will be executed and the other will block. The blocking mechanism is indeed sub-optimal, the performance improvement can be done later (a follow-up issue will be added).
* feat(builder): checkbox for tos on login page
* feat(builder): submit agent page
DOES NOT WORK
* feat(builder): basic upload (not working)
* feat(builder): submit page more working but still not
* fix(builder): working categories, not dynamic
* feat(builder, server): enable submissions (auth error)
* fix(lint): linting
* feat(builder): submit page terms of service
* fix(builder): update lockfile
* lint(builder): lint marketplace files
- Add static link/connection support on the frontend and display them as dashed lines
- Remove queueing for static connections - there'll always be only one bead waiting at the end
- Make beads slightly larger and further from the end arrow
* Add Advanced Chatbot with History using Discord
* Update Discord Chatbot with History_v145.json
update is_active to false and is_template to true
---------
Co-authored-by: Bently <tomnoon9@gmail.com>
The execution graph is supposed to be typed, but there are cases where generic types like Any were used, and there are cases, where incompatible data passed into the wrong type.
If such a thing happens on runtime, we should do the best-effort conversion instead of breaking the run. E.g.: try to json-stringify the object to str input, or try to parse number in the string to int input, etc.
* Make `userId` required on DB entities `AgentGraph`, `AgentGraphExecution`, and `AgentGraphExecutionSchedule`
* Add SQLite and Postgres migrations to make `userId` required and set `userId` to `3e53486c-cf57-477e-ba2a-cb02dc828e1a` on existing entries without `userId`
* Amend `create_graph` endpoint and `.data.graph`, `.data.execution` methods to handle required `user_id`
* Add `.data.user.DEFAULT_USER_ID` constant to replace hardcoded literals
* refactor(builder): Migrate `FlowEditor` to use ReactFlow's state management system
We have been keeping two copies of node and edge data: one inside ReactFlow and one outside.
It works, but it's accidental and implicit and there is no reason to be using shadow copies rather than a single data source.
- Replace `useNodesState` and `useEdgesState` with `useReactFlow` hook
- Use `addNodes`, `addEdges`, and `deleteElements` where appropriate instead of `setNodes`/`setEdges` to allow use of event hooks
- Consolidate all edge -> node state sync logic into `onEdgesChange` event handler
This replaces `updateNodesOnEdgeChange`, part of `onConnect`, and `onEdgesDelete`.
- Move node deletion logic from `CustomNode` to `FlowEditor:onNodesChange`
* fix(builder): Refactor and fix copy-paste mechanism
- Rename variables for readability
- Use an ID map to correctly set the source and target IDs for the pasted edges
- Move `monitor/page.tsx` to `page.tsx`
- Remove redirect from `/` to `/build`
- Set temporary redirect from `/monitor` to `/` to prevent breaking UX (may be removed after a grace period, e.g. 2024-09-01)
* adding auth to store
* Add ability to submit agents and review them before being added to the market
* Added auth decorator
* Added auth to market api client
* fix(builder): Fix drag-select behavior on `NodeKeyValueInput`
* fix(github): Added in fallback variables for postgres testing (#7715)
Co-authored-by: Leslie Cruz <lelcruz@users.noreply.github.com>
Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
* feat(builder): basic tally feedback form (#7725)
* removed database changes
* moved auth to libs project
* fixed formatting
* cleaned up auth
* Added tests and database migration
* delete decorator
* feat(builder): Add new icons and integrate with ControlPanel
Introduce SVG icons and replace ControlPanel dependencies with new icons. The ControlPanel component now uses the new icon components for improved consistency.
* feat(builder): add additional icon and update icons in NavBar
Introduced the new icon with relevant documentation and examples. Replaced existing icon imports with the newly defined icons in the NavBar component for consistency.
* feat(builder): Add icon for megaphone and replace usage
Introduced the IconMegaphone for reuse across the application. Updated TallyPopup to utilize IconMegaphone instead of the previous Megaphone icon from lucide-react.
* fix(builder): Running prettier to format changed files.
Adjusted various files for consistent code formatting. Ensured proper spacing and alignment of imports, JSX tags, and object properties to enhance readability and maintain coding standards. No functional changes made.
- Amend `AutoGPTServerAPI.sendWebSocketMessage(..)` to automatically (re)connect the websocket if disconnected
- Amend `AutoGPTServerAPI.connectWebSocket()` to prevent race conditions
* adding auth to store
* Added auth decorator
* Added auth to market api client
* removed database changes
* moved auth to libs project
* fixed formatting
* Switched to using fastapi dependencies
* Return a user object
* removed logging of the token
* Added tests
### Background
CurrentDateAndTimeBlock would fail if the test is not complete within 1-second wall-time.
In the case a test started at the second 01:59:59, it becomes flaky.
We can change the test to only assert the type. But this is also a good chance to add more assertion options for Block: a custom function.
### Changes 🏗️
Change assertion for the time block using an additional margin of error.
* Added listing, sorting, filtering and ordering of agents
* feat(market): general upkeep for vscode and small docs
* feat(market): most of search
* fix(market): hinting on the sort was weird + linting
* feat(market): migrations and schema updates
* lint(market): autolint
* feat(market): better search
* feat(market): file download
* feat(market): analytics of downloads
* Added tracking of views
* changed all imports to be fully qualified
* Upgrade sentry sdk
* Added an admin endpoint to submit new agents
* fixes
* Added endpoint that just tracks download
* Starting adding the marketplace page
* Marketplace client
* Create template of the marketplace page
* Updated client
* fix(market): debug port
* feat(market): agents by downloads
* fix(market, builder): hook up frontend and backend
* feat(builder, market): build a "better" market page that loads data
* feat(builder): updated search (working) and page (kinda working)
* feat(builder): add a feature agents ui (not backed yet)
* feat(builder): improve detail page content
* Added run script
* Added pre populate database command
* Add AnalyticsTracker on create agent
* Add download counts for top agents
* Add hb page prometheus metrics
* Added featured agents funcitonality
* renamed endpoint to health
* Adding download flow
* normalised api routes
* update readme
* feat(market) : default featured
* formatting
* revert changes to autogpt and forge
* Updated Readme
* Eerror when creating an agent from a template installed from (#7697)
fix creating graph from template
* Add dockerfile
* z level fix
* Updated env vars
* updated populate url
* formatting
* fixed linting error
* Set defaults
* Allow only next.js dev server
* fixed url
* removed graph reassignment as due to change in master
---------
Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
### Background
This change brings the capability to decompose a graph into sub-graphs. The objective of this feature is to allow a user to build a visually modular, and easier-to-understand graph. Also, allowing you to import a graph into your existing graph, without decluttering your existing graph.
This feature will require more implementation on the UI side, to allow the grouping of subgraph to be represented as a node in the builder.
### Changes 🏗️
Introduced a subgraph functionality with the following property:
* Sub-graph is simply a set of nodes that are grouped together, making it representable as a node.
* Sub-graph input & output pins/schema are the `InputBlock` / `OutputBlock` nodes present in the subgraph.
* The previous point implies that connecting two nodes from different sub-graphs, other than input/output nodes, is not allowed.
* Graph can be nested, but defined flatly, e.g.: graph is now only represented by three components: nodes, links, and subgraphs (a set of list of nodes). A nested subgraph is simply connecting a node inside a subgraph into another `InputBlock` node of another subgraph.
* fix(builder): Adding prettier configuration files and to package.
* fix(builder): Running script "format" added to the package.json
* feat(builder): Adding a job to the yaml file. This job will run "format" which leverages prettier.
* feat(builder): Running script "format" and merging master
* feat(builder): Setting configuration to prettier defaults in .prettierrc.json, and adding a requested newline in the .prettierignore
* feat(builder): Updating the CI to not add a job for prettier but instead add a check to verify prettier was run before commiting.
* feat(builder): Confirming CI update fails when user does not run prettier first. Updating with file changes after prettier
* feat(builder): Running prettier write to fix warnings
* fix(builder): Removing .prett
per PR change request
* fix(builder): Running prettier formatter
* fix(builder): Running prettier formatter check found additional files
* fix(builder): Running prettier format
* fix(builder): Removing running "format" command from PR due to a change request.
* fix(builder): Removing running "format" command from PR due to a change request.
---------
Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
* feat(Block): Add AdvancedLlmCallBlock
Adds a block for handling advanced LLM calls, enabling messages to be handled within the AutoGPT builder.
* fix linting
* Super early version of the discord bots blocks
* updated to add secrets for token + other fixes
* lint & format
* rename DiscordBot to DiscordReader
* add discord-py
* fix poetry lock
* rm duplicated file
* updated name to add Block to end
* update .env.template to add DISCORD_BOT_TOKEN
* updates to add description Field
* swap channel name and message content + add field description
---------
Co-authored-by: Bently <bently@bentlybro.com>
- Merge `Flow.tsx:CustomNodeData` type definition into `CustomNode.tsx:CustomNodeData`
- Move `lib/types:BlockSchema` type definition into `lib/autogpt-server-api/types` in place of `ObjectSchema`
- Expand and rename `BlockSchema` -> `BlockIOSchema` + `BlockIORootSchema`
- Fix all `BlockIOSchema` related type narrowing checks
- Add warning messages to fallback cases in `NodeInputField` logic
Co-authored-by: Swifty <craigswift13@gmail.com>
* feat(Builder): Implement undo/redo functionality
* updates to work with latest UI
* add CTRL + Z & CTRL + Y support
* fixed undo/redo for inputs in nodes
* fix for deleting node
* fixes to make the undo/redo work better
* small fix
* Updates based on feedback
* add margin right to space out buttons
* added CTRL + SHIFT + Z for redo
This PR adds Supabase Auth (cloud) integration, login and profile UI, configures password login and three OAuth providers: Google, GitHub and Discord.
For `Account` button to show up and ability to login two env vars need to be set in `.env.local`: `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_ANON_KEY`. OAuth providers are by the Supabase and don't require env vars.
Email confirmation (for email/password signup) is disabled because there's limit of 3 emails per hour without custom SMTP server configuration. [Link](https://supabase.com/dashboard/project/adfjtextkuilwuhzdjpf/auth/templates) to configure custom SMTP server and email template.
### Added dependencies:
- "@supabase/ssr": "^0.4.0"
- "@supabase/supabase-js": "^2.45.0"
- "react-icons": "^5.2.1"
### Added pages/routes:
- `app/auth/auth-code-error/page.tsx`: displayed when login using OAuth provider fails
- `app/auth/callback/route.ts`: route accessed when logging in using OAuth provider; it passes session code to Supabase
- `app/auth/confirm/route.ts`: accessed when confirming email, users will be directed here from email they get after signing in.
- `app/error/page.tsx`: Generic error page without explanation (any errors should be visible in the console)
- `app/login/page.tsx` and `app/login/actions.ts`: Login page and related login/signup server actions
- `app/profile/page.tsx`: Profile page, displays email address of the user and button to logout
### Changes
- Update `layout.tsx`: add `Log In` button and make icons consistent. The log in button shows up if user is logged out, avatar is shown when logged in, and if supabase is unavailable nothing shows up.
- Login form is verified using `zod` on the frontend (recommended by shadcn) and in case login fails feedback is displayed. On successful login users are redirected to `/profile`
- Add `PasswordInput` component, [source](https://gist.github.com/mjbalcueva/b21f39a8787e558d4c536bf68e267398)
- Add `SupabaseProvider` with context for Supabase accessed via hook `useSupabase(): { supabase: SupabaseClient | null, isLoading: boolean }`
- Add `useUser` hook to get `{ user, session, isLoading, error }` on the client
- Add `getServerUser`: async function to get `{ user: User | null, error: string | null }` on the server side
- Add `src/middleware.ts` and `client.ts`, `server.ts`, `middleware.ts` in `src/lib/supabase` which are utility functions and middleware to refresh auth token
### Background
We need an explicit block for providing input & output for the graph.
This will later allow us to build a subgraph with pre-declared input & output schema.
This will also allow us to set input for the node in the middle of the graph, and enable a graph to have output values.
### Changes 🏗️
* Add InputBlock & OutputBlock
* Add graph structure validation on the graph execution step that asserts the following property:
- All mandatory input pin, has to be connected or have a default value, except the `InputBlock` node.
- All links have to connect valid nodes, and the sink & source name using the valid block field.
* Feat(Builder): Clear Status and Output upon graph edit
* close output dropdown on graph edit
* make deleting edge clear block outputs
* make it so deleting nodes clears block output
### Background
Migration not being synced has caused issues and CI is not catching this yet.
### Changes 🏗️
* Added schema check in both sqlite & postgres prisma.schema on linting step.
* Introduced `poetry run schema` for syncing prisma.schema + generating migration in both files.
* Set up helm and tf for backend
* update helm charts and settings
* remove example files
* use latest tag
* delay and timeouts for probes
* env based pyro host
* default backend
* linting
* add helm linting in CI
* read from settings
* fix formatting
* update to use config
* Set up helm and tf for backend
* update helm charts and settings
* remove example files
* use latest tag
* delay and timeouts for probes
* env based pyro host
* default backend
* linting
* read from settings
* fix formatting
* update to use config
* fix(builder): Implementing a basic shadCn theme until color palette is decided upon
* feat(builder): Separating NavBar into its own component and providing a standard UI/UX Approach
* feat(builder): Removing old implementation of logo, removing excessive css implementation, updating styles to better support standard desktop views.
* feature(builder): Addition of UI component Sheet from ShadCn for update
### Background
Pyro for API Server is not using Prisma, but still holding a Prisma connection.
The fast-API thread is also holding a Prisma connection, making Prisma connected in two different loop within a single process.
### Changes 🏗️
Disable a Prisma connection on Pyro thread for Server API process.
Fix test flakiness issue due to concurrency issue.
### Background
Input from the input pin is consumed only once. While this is required in most of the use cases, there are some cases where the input can only be produced once, and that input needs to be re-used just like an input default value, that is passively providing input data, without triggering any execution. The scope of this change is providing that functionality in the link level, this property will be called **`static link`** in this system.
### Changes 🏗️
Provides a static link feature with the following behaviours:
* A link can be marked `static` to become a static link.
* Once a node produces an output it will persist the output data and propagate the output to the other nodes through the link, for a static link, instead of making the data queued in the input pin, it will override the default value.
* Any input executions still waiting for the input will be backfilled using this output produced by the static link.
* And any upcoming executions that will use the input will always reuse the output produced by the static link.
See the added test to see the expected usage.
- Add `ajv` dependency to check values against json schema
- Add `errors` and `setErrors` to `CustomNodeData`
- Add `validateNodes` run before executing agent
- Add `*` on labels for required fields
- Add `setNestedProperty` and `removeEmptyStringsAndNulls` utility function
- Fix type signatures of `sendWebSocketMessage(..)`, `onWebSocketMessage(..)`, `runGraph(..)` in `autogpt-server-api/client`
- Add `WebsocketMessageTypeMap`
- Fix type signature of `updateNodesWithExecutionData` in `FlowEditor`
### Background
When multiple executors are executing the same node within the same graph execution, two node executions can read the same queue of input and read the same value—making the data that is supposed to be consumed once, consumed by two executions. The lack of lock & concurrency support for parallel execution within a single graph causes this issue.
Node concurrency also introduces poor UX in the current frontend implementation, when two nodes are executed in parallel, the current UI will not display its parallel execution update, but instead, it shows the updates that override each other. Until the execution observability is improved on the builder UI, this capability will be limited.
### Changes 🏗️
The scope of this change is to solve this issue by:
* Decouple Graph execution & Node execution, each has its own configured process pool.
* Make sure there is only 1 execution per node (we still allow parallel executions on different nodes) in a graph.
* Fixed concurrency issue by adding distributed lock API on agent_server.
* Few cleanups:
- Add more logging with geid & neid prefix on graph/node executions
- Moved execution status update to agent-server for a single source of status update (required by conn-manager/web-socket)
- Configured node parallelism to 10 & graph parallelism to 10 by default, so in the very rare worst-case, there can be 100 node executions.
- Re-use server resource for each integration test run
- Set `node.data.connections` based on `graph.links` in `loadGraph(..)`
- Use reactflow's built-in `useNodesState`, `useEdgesState` to replace some boilerplate functions that do exactly the same
Resolves#7392
* refactor(MathsBlock): Simplify output to return numeric result directly
- Remove MathsResult class and explanation field
- Update Output schema to use float type
- Simplify run method to yield numeric result only
- Adjust error handling to return inf or nan for errors
- Update test cases to reflect new output structure
* run format
* refactor(CounterBlock): Simplify output to return count as integer
- Remove CounterResult class
- Update Output schema to use int type directly
- Simplify run method to yield count without explanation
- Modify error handling to return -1 for any errors
- Update test case to reflect new output structure
* ci(server): add sqlite processing
* ci(server): try setting DATABASE_URL based on db platform
* fix(server): swap default back to sqlite
* ci(server): go back to database url
---------
Co-authored-by: Aarushi <50577581+aarushik93@users.noreply.github.com>
* replace SQLite with Postgres
* dockerfiles and optional docker compose set up
* Update rnd/autogpt_builder/Dockerfile
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
* address feedback
* Update .dockerignore
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
* Remove example files folder
* remove backend and frontend from docker compose
---------
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
* feat: Add YouTubeTranscriber block for extracting transcripts from YouTube videos
* feat: Add youtube-transcript-api dependency to pyproject.toml
* feat: Add SchemaField and test_mock to YoutTube Transcriber.
* feat: update lock
* fix(server): the agbenchmark was out of date
* fix(server): linting
* fix(server): drop mock
* fix(server): poetry locked in
* fix(server): test had ... at the end?
---------
Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
Fixes#7508
- Amend `app/configurator.py:check_model(..)` to check multiple models at once and save duplicate API calls
- Amend `MultiProvider.get_available_providers()` to verify availability by fetching models and handle failure
feat: Add support for new Groq models
The commit adds support for new Groq models, including LLAMA3_1_405B, LLAMA3_1_70B, and LLAMA3_1_8B. These models are part of the preview release and offer enhanced reasoning and versatility capabilities.
* feat(blocks): Add MathsBlock for performing mathematical operations
The commit adds a new block called MathsBlock to perform various mathematical operations such as addition, subtraction, multiplication, division, and exponentiation. The block takes input parameters for the operation type, two numbers, and an option to round the result. It returns the result of the calculation along with an explanation of the performed operation.
---------
Co-authored-by: Swifty <craigswift13@gmail.com>
* feat: Add RSSReaderBlock for reading RSS feeds
The commit adds a new `RSSReaderBlock` class in the `rss-reader-block.py` file. This block allows users to read RSS feeds by providing the URL of the feed, start datetime, polling rate, and a flag to run the block continuously. The block fetches the feed using the `feedparser` library and returns the title, link, description, publication date, author, and categories of each RSS item.
This commit also includes the addition of the `feedparser` dependency in the `pyproject.toml` file.
* fix(server): update lock file
* updated poetry lock
* fixed rss reader testing
* Updated error message in test to include check info
* Set starttime as 1 day ago
* Changed start time to time period
---------
Co-authored-by: Swifty <craigswift13@gmail.com>
- Handles:
- Add `NodeHandle` to draw input and output handles
- Position handles relatively
- Make entire handle label clickable/connectable
- Add input/output types below labels
- Change color on hover and when connected
- "Connected" no longer shows up when connected
- Edges:
- Draw edge above node when connecting to the same node
- Add custom `ConnectionLine`; drawn when making a connection
- Add `CustomEdge`; drawn for existing connections
- Add arrow to the edge end
- Colorize depending on type
- Input field modal:
- Select all text when opened
- Disable node dragging
- CSS:
- Remove not needed styling
- Use tailwind classes instead of css for some components
- Minor style changes
- Add shadcn switch
- Change bottom node buttons (for properties and advanced) to switches
- Format code
- fix(builder/monitor): Export `Graph` rather than `GraphMeta`
- Fixes#7557
- refactor(builder): Split up `lib/autogpt_server_api` into multi-file module
- Resolves#7555
- Rename `lib/autogpt_server_api` to `lib/autogpt-server-api`
- Split up `lib/autogpt-server-api` into `/client`, `/types`
- Move `ObjectSchema` from `lib/types` to `lib/autogpt-server-api/types`
- Make definition of `Node['metadata']['position']` independent of `reactflow.XYPosition`
- fix(builder/monitor): Strip secrets from graph on export
- Resolves#7492
- Add `safeCopyGraph` function in `lib/autogpt-server-api/utils`
- Use `safeCopyGraph` to strip secrets from graph on export in `/monitor` > `FlowInfo`
### Background
Input from the input pin is consumed only once, and the default input can always be used. So when you have an input pin overriding the default input, the value will be used only once and the following run will always fall back to the default input. This can mislead the user.
Expected behaviour: the node should NOT RUN, making connected pins only use their connection(s) for sources of data.
### Changes 🏗️
* Make pin connection the mandatory source of input and not falling back to default value.
* Fix the type flakiness on block input & output. Unify the typing for BlockInput & BlockOutput using the right alias to avoid wrong typing.
* Add comment on alias
* automated test on the new behaviour.
- Let `GET /graphs` return `GraphMeta[]` instead of `string[]` (list of IDs)
- Rename `AutoGPTServerAPI` method `listGraphIDs` -> `listGraphs` and adjust return type
- Replace all usages of `Graph` with `GraphMeta` in `/monitor`
- Delete `data.graph:get_graph_ids()`
This commit updates the `CreateMediumPostBlock` class in `create_medium_post.py` to use the secret value for the `author_id` parameter. Previously, it was using the plain value, which caused the value to be sent incorrectly to the API.
* feat: Add CreateMediumPostBlock to create Medium posts
* feat: Add medium_api_key to Secrets class in settings.py
* feat: Update medium post block to work with latest system.
* feat: Add medium_author_id field to Secrets class in settings.py
* run isort
* run black
Builder:
* Add download button to agent info view
- Add download button to `FlowInfo`
- Add `exportAsJSONFile(..)` function to lib/utils.ts
* Add Create button + menu to /monitor page
- Add "Create | v" split button to Agent list
- Add list of templates to Create menu
- Add "Import from file" option + dialog
- Create `AgentImportForm` component
- Install `Form`, `Label`, `Switch` components from shad/cn UI
- Install `Dialog` component from shad/cn
* Support saving/editing Templates
- Add `templateID` query parameter to `/build`
- Use `templateID` query parameter in `AgentImportForm` redirect if imported as template
- Make `FlowEditor` suitable for saving/editing templates
- Add `template` (boolean) parameter to `FlowEditor` component
- Add conditions to all `createGraph` or `updateGraph` calls, to use `createTemplate`/`updateTemplate` if applicable
- Add "Save as Template" button, visible if the graph is new (unsaved)
- Hide "Save & Run Agent" button when editing a template
* Add template endpoints to `AutoGPTServerAPI` client
- Add `listTemplates()`
- Add `getTemplate(id, version?)`
- Add `getTemplateAllVersions(id)`
- Add `createTemplate(templateCreateBody)`
- Add `updateTemplate(id, template)`
* fix inner alignment of `<Input type="file">` elements
Server:
* fix(server): Fix return of `create_graph` for templates
- Add prefix `/api` to `APIRouter` in server.py
- Update API client in Builder
- Update default `AGPT_SERVER_URL` in .env.template
- Update default `baseUrl` in `AutoGPTServerAPI` constructor
* Add minimal implementation of `LlamafileProvider`, a new `ChatModelProvider` for llamafiles. It extends `BaseOpenAIProvider` and only overrides methods that are necessary to get the system to work at a basic level.
* Add support for `mistral-7b-instruct-v0.2`. This is the only model currently supported by `LlamafileProvider` because this is the only model I tested anything with.
* Add instructions to use AutoGPT with llamafile in the docs at `autogpt/setup/index.md`
* Add helper script to get it running quickly at `scripts/llamafile/serve.py`
---------
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
### Background
Add formatter & linter command.
Tools: ruff --> isort --> black --> pyright.
### Changes 🏗️
Introduced:
* `poetry run format`
* `poetry run lint`
`poetry run lint` will be executed on CI.
- Renamed `Schema` to `BlockSchema` and moved to `lib/types.ts`
- Add `SchemaTooltip` component that renders markdown tooltip for node fields
- Add `SecretField` function (which uses `BlockSecret` as value) that replaces `BlockFieldSecret` functionality for models
- Rename `get` to `get_secret_value` to make name clearer and inline with pydantic `Secret` types
- Add shadcn tooltip
- Add `react-markdown` dependency
- Add `SchemaField` that works like Pydantic `Field` but allows to add extra json schema values. This PR adds `placeholder` entry but it could be extended with other data.
- Render `placeholder` inside input fields if available.
- Restyle placeholders so they are visually distinct from user-entered values
### Background
The main scope of this change is enhancing the system capability (by fixing bug, correcting execution behaviour) to allow for creating a graph with a loop, to allow the use case of block auto-generation agent.
### Changes 🏗️
* Main changes: Add block_autogen.py (block auto-generation agent graph example).
* Refactor on test boilerplate: introduced `util/test` for initiating a server, and waiting graph execution.
* Removing unnecessary db lookup and duplicated codes used for sending execution updates on agent executor.
* Removed redundant code on test and cli code.
* Moved block test execution helper into the main code (so blockinstallerblock can use it).
* Eliminate the need of explicitly add a module into the `AVAILABLE_BLOCKS` list, any block class under the `block` folder will be auto-discovered.
* Few patches on the existing blocks.
1. Add graph versioning functionality:
- Add `version`, `isActive` fields in the `AgentGraph` model
- Add `agentGraphVersion` field in related models
- Amend & add API endpoints for graph versioning (see below)
- Amend & add data layer functions (`autogpt_server.data`) to support new operations & data schema
2. Add graph template functionality:
- Add `isTemplate` fields in the `AgentGraph` model
- Add `GraphMeta` model for template/graph metadata
- Add API endpoints for template management (see below)
- Amend & add data layer functions (`autogpt_server.data`) to support new operations & data schema
3. Enhance graph creation:
- Amended `create_graph` route to handle template-based graph creation
4. Code refactoring:
- Improved import statements
- Enhanced error handling in graph creation
5. Minor improvements:
- Add validator to auto-assign `Graph.id` if not set
## API Changes
New endpoints:
- `GET /templates`: Retrieve all templates (metadata only)
- `POST /templates`: Create a new template
- `PUT /graphs/{graph_id}`: Create a new version of a graph
- `GET /templates/{graph_id}`: Get a specific template
- `PUT /templates/{graph_id}`: Create a new version of a graph template
- `GET /graphs/{graph_id}/versions`: Get all versions of a graph
- `GET /templates/{graph_id}/versions`: Get all versions of a graph template
- `GET /graphs/{graph_id}/versions/{version}`: Get a specific graph version
- `PUT /graphs/{graph_id}/versions/active`: Set active graph version
Modified endpoints:
- `POST /graphs`: Now supports creating graphs directly from templates
- `GET /graphs/{graph_id}`: Add `version` query parameter
- `GET /graphs/{graph_id}/executions`: Add `graph_version` query parameters
## UI changes
- Improve `/build` / `FlowEditor` save mechanism
- Implement updating current agent instead of creating a new agent on every save
- Add check to only save a new version if local graph has been edited
- Add `deepEquals` function to lib/utils.ts
- Add version indicators and selector on `/monitor`

- Add shad/cn `DropdownMenu` component
- Update `AutoGPTServerAPI` client
- Update input/output types with added attributes (see above)
- Add parameter `version` to `getFlow`
- Add parameter `flowVersion?` to `listFlowRunIDs`
- Add endpoint `updateFlow(flowID, FlowUpdateable)`
- Add endpoint `createFlow(fromTemplateID, templateVersion)` (overload)
- Add endpoint `getFlowAllVersions(id)`
- Add endpoint `setFlowActiveVersion(flowID, version)`
This commit adds support for the following models:
```python
# OpenAI Models
GPT4O = "gpt-4o"
GPT4_TURBO = "gpt-4-turbo"
GPT3_5_TURBO = "gpt-3.5-turbo"
# Anthropic models
CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20240620"
CLAUDE_3_HAIKU = "claude-3-haiku-20240307"
# Groq models
LLAMA3_8B = "llama3-8b-8192"
LLAMA3_70B = "llama3-70b-8192"
MIXTRAL_8X7B = "mixtral-8x7b-32768"
GEMMA_7B = "gemma-7b-it"
GEMMA2_9B = "gemma2-9b-it"
```
Every model has been tested with a single LLM block and is confirmed to be working in that setup.
- Add `autogpt` and `forge` dependency to the `autogpt_server`
- Add `AutoGPTAgentBlock` that initializes and runs a single agent loop on execution
- Add `BlockAgent` that inherits from `autogpt` `Agent` and is a thin extension on the agent that allows to disable components
- Add `OutputComponent` that adds `output` command for the agent
- Improve responsive grid layout
- Remove `container` class from `<main>` to utilize full screen width
- Improve detail views & add view for run details
- Make flow run list entries selectable
- Create `FlowInfo` and `FlowRunInfo` components
- Improve layout of `FlowRunsStats`
- Improve ScrollableLegend spacing & styling
- Hide scroll bar of scrollable legend
- Center legend items if there is space left
- Round icons
- Vertically align icons with labels
- FIX: Add condition to not display legend items for series with `legendType="none"`
- Add periodic 5s refresh of non-terminal flow run statuses
- Split off `refreshFlowRuns(flowID)` from `fetchFlowsAndRuns()`
- Add effect to run `refreshFlowRuns` every 5 seconds
- Improve and expand FlowRun info
- Add `FlowRun.totalRunTime`: sum of the individual execution durations of all nodes
- Add `FlowRun.endTime`
- Use `NodeExecutionResult.add_time` instead of `start_time` as `FlowRun.startTime`
- Sort Flows by last executed
- Add icons to navbar items & hide unused items Backtrack and Explore
- Change UI mentions of "(Agent) Flow" to "Agent"
### Background
Credentials for blocks could only be defined through the block input. The scope of this change is providing system-wide that becomes the default value for these input blocks.
### Changes 🏗️
* Add system-wide credential support for agent blocks `BlockFieldSecret`.
* Update llmcall & reddit block to adopt `BlockFieldSecret`.
* reverts dark theme for now
* change "Show/Hide nodes" button to be "Icon"
* swap over to light mode + fix sizing
* fix color for agent name + description text
* Change navbar to white
* Added darkmode tag for the navbar
* Added dark mode text color
* Changed to tailwind classes
---------
Co-authored-by: Bentlybro <tomnoon9@gmail.com>
* reverts dark theme for now
* change "Show/Hide nodes" button to be "Icon"
* swap over to light mode + fix sizing
* fix color for agent name + description text
* Change navbar to white
* Added darkmode tag for the navbar
* Added dark mode text color
---------
Co-authored-by: Bentlybro <tomnoon9@gmail.com>
* reverts dark theme for now
* change "Show/Hide nodes" button to be "Icon"
* swap over to light mode + fix sizing
* fix color for agent name + description text
* update icon
Sample test input and output on the block can serve as documentation and auto-generated unit-testing code for the agent block.
What's within the scope of this change:
Adding the fields for block test (input, output, mocks), and its execution.
What's still outside the scope:
Handling of mock and stub for a block using sensitive credentials or network calls or 3rd-party connections.
* Refactor on the link structure and API
* Refactor on the link structure and API
* Cleanup IDS
* Remove run_id
* Update block interface
* Added websockets dependency
* Adding routes
* Adding in websocket code
* Added cli to test the websocket
* Added an outline of the message formats I plan on using
* Added webscoket message types
* Updated poetry lock
* Adding subscription logic
* Updating subscription mechanisms
* update cli
* Send updates to server
* Get single execution data
* Fix type hints and renamed function
* add callback function and type hints
* fix type hints
* Updated manager to use property
* Added in websocket updates
* Added connection manager tests
* Added tests for ws_api
* trying to work around process issues
* test formatting
* Added a create and execute command for the cli
* Updated send format
* websockets command working
* cli update
* Added model.py
* feat: Update server.py and manager.py
- Initialize blocks in AgentServer lifespan context
- Remove unnecessary await in AgentServer get_graph_blocks
- Fix type hinting in manager.py
- Validate input data in validate_exec function
* fix tests
* feat: Add autogpt_server.blocks.sample and autogpt_server.blocks.text modules
This commit adds the `autogpt_server.blocks.sample` and `autogpt_server.blocks.text` modules to the project. These modules contain blocks that are used in the execution of the Autogpt server. The `ParrotBlock` and `PrintingBlock` classes are imported from `autogpt_server.blocks.sample`, while the `TextFormatterBlock` class is imported from `autogpt_server.blocks.text`. This addition enhances the functionality of the server by providing additional blocks for text processing and sample operations.
* fixed circular import issue
* Update readme
---------
Co-authored-by: Zamil Majdy <zamil.majdy@agpt.co>
* feat(autogpt_builder): Add `AutoGPTServerAPI` client
* migrate API calls in Flow.tsx to new API client
* feat(autogpt_server): Add `/graphs/{graph_id}/executions` endpoint
In `data/execution.py`:
- Add `list_executions` function
- Rename `get_executions` to `get_execution_results`
In `server/server.py`:
- Add route
- Add `AgentServer.list_graph_runs`
- Rename `AgentServer.get_executions` to `get_run_execution_results`
* feat(autogpt_builder): Add `listFlowRunIDs` endpoint to `AutoGPTServerAPI` client
* Move `Schema` to `types.ts` and rename to `ObjectSchema`
* feat(rnd): Add type hint and strong pydantic type validation for block input/output + add reddit agent-blocks.
* feat(rnd): Add type hint and strong pydantic type validation for block input/output + add reddit agent-blocks.
* Fix reddit block
* Fix serialization
* Eliminate deprecated class property
* Remove RedditCredentialsBlock
* Cache jsonschema computation, add dictionary construction
* Add dict_split and list_split to output, add more blocks
* Add objc_split for completeness, int both input and output
* Update reddit block
* Add reddit test (untested)
* Resolved json issue on pydantic
* Add creds check on client
* Add dict <--> pydantic object flexibility
* Fix error retry
* Skip reddit test
* Code cleanup
* Chang prompt
* Make this work
* Fix linting
* Hide input_links and output_links from Node
* Add docs
* updating UI to handle deeply nested data structures for reddit usecase
* changing expected key in reddit post to comment
---------
Co-authored-by: Zamil Majdy <zamil.majdy@agpt.co>
* feat(rnd): Add type hint and strong pydantic type validation for block input/output + add reddit agent-blocks.
* feat(rnd): Add type hint and strong pydantic type validation for block input/output + add reddit agent-blocks.
* Fix reddit block
* Fix serialization
* Eliminate deprecated class property
* Remove RedditCredentialsBlock
* Cache jsonschema computation, add dictionary construction
* Add dict_split and list_split to output, add more blocks
* Add objc_split for completeness, int both input and output
* Update reddit block
* Add reddit test (untested)
* Resolved json issue on pydantic
* Add creds check on client
* Add dict <--> pydantic object flexibility
* Fix error retry
* Skip reddit test
* Code cleanup
* Chang prompt
* Make this work
* Fix linting
* Hide input_links and output_links from Node
* Add docs
---------
Co-authored-by: Aarushi <50577581+aarushik93@users.noreply.github.com>
- Add `google-api-python-client-stubs` dev dependency
- Add version specification to `google-api-python-client` dependency
- Fix type error (by ignoring it) in forge/components/web/search.py
Update Pydantic dependency of `autogpt`, `forge` and `benchmark` to `^2.7`
[Pydantic Migration Guide](https://docs.pydantic.dev/2.7/migration/)
- Migrate usages of now-deprecated functions to their replacements
- Update `Field` definitions
- Ellipsis `...` for required fields is deprecated
- `Field` no longer supports extra `kwargs`, replace use of this feature with field metadata
- Replace `Config` class for specifying model configuration with `model_config = ConfigDict(..)`
- Removed `ModelContainer` in `BaseAgent`, component configuration dict is now directly serialized using Pydantic v2 helper functions
- Forked `agent-protocol` and updated `packages/client/python` for Pydantic v2 support: https://github.com/Significant-Gravitas/agent-protocol
---------
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
- Implement message based history in `ActionHistoryComponent`
- Make non-summarized message count configurable (`ActionHistoryComponent.full_message_count`)
- Run `ActionHistoryComponent` after `SystemComponent` so that history messages are last in the prompt
- Omit final instruction message if prompt already contains assistant messages
- Filter `raw_message` from `ActionProposal.schema()`
---------
Co-authored-by: Krzysztof Czerwinski <kpczerwinski@gmail.com>
* Create optional `build` dependency group
* Move `cx-freeze` dependency to `build` dependency group
To include the `build` group when installing dependencies, run `poetry install --with=build`.
Fixes#7297 (`cx-freeze` dependency install fails after #7271)
On AgentServer, To create a Block like StringFormatterBlock or LllmCallBlock, we need some way to dynamically link input pins and aggregate them into a single list input. This will give a better experience for the user to construct an input and link it from the output of the other nodes. The scope of this change is adding support for that in the least intrusive way.
Proposal
To differentiate the input list name and its singular entry we are using the $_<index> prefix. For example:
For the input items: list[int], you can set a pin items with values like [1,2,3,4]. But you can also add input pins like items_$_0 or items_$_4 with values 1 or 2, which will be appended to the items input in alphabetical order.
The execution engine will guarantee to wait for the execution until all the input pin value is produced, so input pin with list input will produce fix-sized list.
* Getting started with nextjs
* fix linting
* remove gitignore for package.json
* pulling in reactflow components
* updating css
* use environment variables
* clean up css / ui a lil
* Fixed nodes/run button animation
so they are always visible
---------
Co-authored-by: Bentlybro <tomnoon9@gmail.com>
### Background
The current implementation of AgentServer doesn't allow for a single pin to be connected to multiple nodes, this will be problematic when you have a single output node that needs to be propagated into many nodes. Or multiple nodes that possibly feed the data into a single pin (first come first serve).
This infra change is also part of the preparation for changing the `block` interface to return a stream of output instead of a single output. Treating blocks as streams requires this capability.
### Changes 🏗️
* Update block run interface from returning `(output_name, output_data)` to `Generator[(output_name, output_data)]`
* Removed `agent` term in the API, replace it with `graph` for consistency.
* Reintroduced `AgentNodeExecutionInputOutput`. `AgentNodeExecution` input & output will be a list of `AgentNodeExecutionInputOutput` which describes the input & output data of its execution. Making an execution has 1-many relation to its input output data.
* Propagating the relation and block interface change into the execution engine.
### Background
Agent execution should be able to be triggered in a recurring manner.
This PR introduced an ExecutionScheduling service, a process responsible for managing the execution schedule and triggering its execution based on a predefined cron expression.
### Changes 🏗️
* Added `scheduler.py` / `ExecutionScheduler` implementation.
* Added scheduler test.
* Added `AgentExecutionSchedule` table and its logical model & prisma queries.
* Moved `add_execution` from API server to `execution_manager`
### Background
This PR adds support on IPC on autogpt_server.
To make this happen, there are a couple of refactoring efforts being made (will be described in the `Changes` section).
Currently, there are three independent processes:
```
AgentServer ----> ExecutionManager
|
--> ExecutionScheduler
```
### Changes 🏗️
* Added Pyro5 for IPC support.
* Introduced `AppService`: a class to construct an independent process that can expose a method to other running processes (this is analogous to a microservice).
* Introduced `AppProcess`: used by `AppService` a class for creating a child process that can be executed in the background.
* Adapting existing codebase to user `AppService`.
Remove many env vars and use component-level configuration that could be loaded from file instead.
### Changed
- `BaseAgent` provides `serialize_configs` and `deserialize_configs` that can save and load all component configuration as json `str`. Deserialized components/values overwrite existing values, so not all values need to be present in the serialized config.
- Decoupled `forge/content_processing/text.py` from `Config`
- Kept `execute_local_commands` in `Config` because it's needed to know if OS info should be included in the prompt
- Updated docs to reflect changes
- Renamed `Config` to `AppConfig`
### Added
- Added `ConfigurableComponent` class for components and following configs:
- `ActionHistoryConfiguration`
- `CodeExecutorConfiguration`
- `FileManagerConfiguration` - now file manager allows to have multiple agents using the same workspace
- `GitOperationsConfiguration`
- `ImageGeneratorConfiguration`
- `WebSearchConfiguration`
- `WebSeleniumConfiguration`
- `BaseConfig` in `forge` and moved `Config` (now inherits from `BaseConfig`) back to `autogpt`
- Required `config_class` attribute for the `ConfigurableComponent` class that should be set to configuration class for a component
`--component-config-file` CLI option and `COMPONENT_CONFIG_FILE` env var and field in `Config`. This option allows to load configuration from a specific file, CLI option takes precedence over env var.
- Added comments to config models
### Removed
- Unused `change_agent_id` method from `FileManagerComponent`
- Unused `allow_downloads` from `Config` and CLI options (it should be in web component config if needed)
- CLI option `--browser-name` (the option is inside `WebSeleniumConfiguration`)
- Unused `workspace_directory` from CLI options
- No longer needed variables from `Config` and docs
- Unused fields from `Config`: `image_size`, `audio_to_text_provider`, `huggingface_audio_to_text_model`
- Removed `files` and `workspace` class attributes from `FileManagerComponent`
When an agent is resumed from a mid-cycle state (having made a proposal but not executed it yet), we need to use the previously determined `current_episode.action` proposal instead of calling `agent.propose_action()` again.
* Rename `assert_config_has_openai_api_key` to `assert_config_has_required_llm_api_keys`
* Make OpenAI credential check conditional (only if an OpenAI model is selected in the config)
* Implement checks for Groq and Anthropic credentials
* Use API calls for Groq and OpenAI credential checks to make sure the keys are valid
Revert some changes to fix forge agent and enable components support.
- Rename forge `Agent` to `ProtocolAgent`
- Bring back and update `forge/app.py` and `forge/agent/forge_agent.py`
- `ForgeAgent` inherits from `BaseAgent`, supports component execution and runs the same pipelines as autogpt Agent
- Update forge version from 0.1.0 to 0.2.0
- Update code comments
### Background
This PR implements the main logic of the block execution engine for AutoGPT-Server.
An integration test is added to test the behavior.
*What you can do now with this PR*:
You can manually create a graph, by using the existing blocks as nodes (or write your own). Then execute the graph with an input.
*What you can't do yet*:
Listen to the graph execution result/update (you can follow the `AgentNodeExecution` table result, though).
### Changes 🏗️
* Split `data.py` (model file) into three modules:
* `execution`: a model for node execution.
* `graph`: a model for graph structure.
* `block`: a model for agent block/component.
* Implemented executor main logic
* Simplify db structure:
* Remove `AgentBlockInputOutput` in favor of `inputSchema` & `outputSchema` using serialized json/dict structure.
* Remove `id` on `AgentBlock` in favor of using name (class name of the block) as its identifier.
* Added `constantInput` column for `AgentNode` for hard-coded input/block configuration. Hence, removing`executionStateData` on `AgentNodeExecution`.
* Rename AgentNodeLink input/output to source/sink to avoid confusion
* Change multithreading to multiprocessing, to allow the use of multiple `prisma` asynchronous client.
Frontend broke in #7171 because of changes to the request models in `forge.agent_protocol`. This PR unbreaks it.
Changes:
- Make `input` required on `TaskRequestBody` and `StepRequestBody`
- Amend `toJson()` on `TaskRequestBody` and `StepRequestBody` to omit attributes with `null` value
### Background
Introduced initial database schema for AutoGPT server.
It currently consists of 7 tables:
* `AgentGraph`: This model describes the Agent Graph/Flow (Multi Agent System).
* `AgentNode`: This model describes a single node in the Agent Graph/Flow (Multi Agent System).
* `AgentNodeLink`: This model describes the link between two AgentNodes.
* `AgentNodeExecution`: This model describes the execution of an AgentNode.
* `AgentBlock`: This model describes a component that will be executed by the AgentNode (all the details required, like name, code, input/output).
* `AgentBlockInputOutput`: This model describes the output (produced event) or input (consumed event) of an AgentBlock.
* `FileDefinition`: This model describe a file that can be used as input/output of an AgentNodeExecution.
### Changes 🏗️
* Add Prisma
* Add sqlite3
* Initialize database.
* Update instructions to set up OpenAI / GPT-4 access
* Add instructions to set up Anthropic access
* Add instructions to set up Groq access
* Remove GPT-specific `--gpt3only`, `--gpt4only` CLI flags and related logic
* Remove duplicate config instructions from docker setup page, replace it by a link to the standard setup instructions
### Background
###### Project Outline
Currently, the project mainly consists of these components:
*agent_api*
A component that will expose API endpoints for the creation & execution of agents.
This component will make connections to the database to persist and read the agents.
It will also trigger the agent execution by pushing its execution request to the ExecutionQueue.
*agent_executor*
A component that will execute the agents.
This component will be a pool of processes/threads that will consume the ExecutionQueue and execute the agent accordingly.
The result and progress of its execution will be persisted in the database.
###### How to test
Execute `poetry run app`.
Access the swagger page `http://localhost:8000/docs`, there is one API to trigger an execution of one dummy slow task, you fire the API a couple of times and see the `agent_executor` executes the multiple slow tasks concurrently by the pool of Python processes.
The pool size is currently set to `5` (hardcoded in app.py, the code entry point).
##### Changes 🏗️
* Initialize FastAPI for the AutoGPT server project.
* Reduced number of queues to 1 and abstracted into `ExecutionQueue` class.
* Reduced the number of main components into two `api` and `executor`.
- Add `_BaseOpenAIProvider`, `BaseOpenAIChatProvider`, and `BaseOpenAIEmbeddingProvider`, which implement the shared functionality of OpenAI-like providers, e.g. `GroqProvider` and `OpenAIProvider`
- (Re)move as much code as possible from `GroqProvider` and `OpenAIProvider` by rebasing them on `BaseOpenAI(Chat|Embedding)Provider`
Also:
- Rename `get_available_models()` to `get_available_chat_models()` on `BaseChatModelProvider`
- Add `get_available_models()` to `BaseModelProvider`
- Add `get_available_embedding_models()` to `BaseEmbeddingModelProvider`
- Move common `fix_failed_parse_tries` config attribute into base `ModelProviderConfiguration`
* Add default AutoGPT profile to ai_profile.py & disable profile generator
* Disable custom AI profile generation in agent_protocol_server.py
- Replace `generate_agent_for_task` by `create_agent`
- Make `ai_profile` parameter on `create_agent` optional (use default `AIProfile` if not passed)
* Generalize example call in profile_generator.py
Currently it's specified in an OpenAI-specific format, which might adversely affect performance with other providers.
* Remove dead `AIProfile.api_budget` attribute
* Remove `agent.ai_profile` and `agent.directives` attributes, and replace usages with `agent.state.*`
This prevents potential state inconsistency between `agent` and `agent.state` when other values are assigned to `agent.ai_profile` and `agent.directives`
- **FIX ALL LINT/TYPE ERRORS IN AUTOGPT, FORGE, AND BENCHMARK**
### Linting
- Clean up linter configs for `autogpt`, `forge`, and `benchmark`
- Add type checking with Pyright
- Create unified pre-commit config
- Create unified linting and type checking CI workflow
### Testing
- Synchronize CI test setups for `autogpt`, `forge`, and `benchmark`
- Add missing pytest-cov to benchmark dependencies
- Mark GCS tests as slow to speed up pre-commit test runs
- Repair `forge` test suite
- Add `AgentDB.close()` method for test DB teardown in db_test.py
- Use actual temporary dir instead of forge/test_workspace/
- Move left-behind dependencies for moved `forge`-code to from autogpt to forge
### Notable type changes
- Replace uses of `ChatModelProvider` by `MultiProvider`
- Removed unnecessary exports from various __init__.py
- Simplify `FileStorage.open_file` signature by removing `IOBase` from return type union
- Implement `S3BinaryIOWrapper(BinaryIO)` type interposer for `S3FileStorage`
- Expand overloads of `GCSFileStorage.open_file` for improved typing of read and write modes
Had to silence type checking for the extra overloads, because (I think) Pyright is reporting a false-positive:
https://github.com/microsoft/pyright/issues/8007
- Change `count_tokens`, `get_tokenizer`, `count_message_tokens` methods on `ModelProvider`s from class methods to instance methods
- Move `CompletionModelFunction.schema` method -> helper function `format_function_def_for_openai` in `forge.llm.providers.openai`
- Rename `ModelProvider` -> `BaseModelProvider`
- Rename `ChatModelProvider` -> `BaseChatModelProvider`
- Add type `ChatModelProvider` which is a union of all subclasses of `BaseChatModelProvider`
### Removed rather than fixed
- Remove deprecated and broken autogpt/agbenchmark_config/benchmarks.py
- Various base classes and properties on base classes in `forge.llm.providers.schema` and `forge.models.providers`
### Fixes for other issues that came to light
- Clean up `forge.agent_protocol.api_router`, `forge.agent_protocol.database`, and `forge.agent.agent`
- Add fallback behavior to `ImageGeneratorComponent`
- Remove test for deprecated failure behavior
- Fix `agbenchmark.challenges.builtin` challenge exclusion mechanism on Windows
- Fix `_tool_calls_compat_extract_calls` in `forge.llm.providers.openai`
- Add support for `any` (= no type specified) in `JSONSchema.typescript_type`
* Add `FileStorage.mount()` method, which mounts (part of) the workspace to a local path
* Add `watchdog` library to watch file changes in mount
* Amend `CodeExecutorComponent`
* Amend `execute_python_file` to execute Python files in a workspace mount
* Amend `execute_python_code` to create temporary .py file in workspace instead of as a local file
* Add support for `Path` argument to `filename` parameter on `execute_python_file`
* Fix `test_execute_python_code` (by making it async)
- Move `autogpt/Dockerfile` to `Dockerfile.autogpt`
- Write new selective `.dockerignore` (in repo root) to keep build context clean
- Amend `autogpt/docker-compose.yml` and all `autogpt-docker-*.yml` workflows accordingly
- Include `forge/` in docker build context so it can be used as a path dependency
- Include `frontend/` in docker builds
- Moved `autogpt` and `forge` to project root
- Removed `autogpts` directory
- Moved and renamed submodule `autogpts/autogpt/tests/vcr_cassettes` to `autogpt/tests/vcr_cassettes`
- When using CLI agents will be created in `agents` directory (instead of `autogpts`)
- Renamed relevant docs, code and config references from `autogpts/[forge|autogpt]` to `[forge|autogpt]` and from `*../../*` to `*../*`
- Updated `CODEOWNERS`, GitHub Actions and Docker `*.yml` configs
- Updated symbolic links in `docs`
Remove unused `forge` code and improve structure of `forge`.
* Put all Agent Protocol stuff together in `forge.agent_protocol`
* ... including `forge.agent_protocol.database` (was `forge.db`)
* Remove duplicate/unused parts from `forge`
* `forge.actions`, containing old commands; replaced by `forge.components` from `autogpt`
* `forge/agent.py` (the old one, `ForgeAgent`)
* `forge/app.py`, which was used to serve and run the `ForgeAgent`
* `forge/db.py` (`ForgeDatabase`), which was used for `ForgeAgent`
* `forge/llm.py`, which has been replaced by new `forge.llm` module which was ported from `autogpt.core.resource.model_providers`
* `forge.memory`, which is not in use and not being maintained
* `forge.sdk`, much of which was moved into other modules and the rest is deprecated
* `AccessDeniedError`: unused
* `forge_log.py`: replaced with `logging`
* `validate_yaml_file`: not needed
* `ai_settings_file` and associated loading logic and env var `AI_SETTINGS_FILE`: unused
* `prompt_settings_file` and associated loading logic and env var `PROMPT_SETTINGS_FILE`: default directives are now provided by the `SystemComponent`
* `request_user_double_check`, which was only used in `AIDirectives.load`
* `TypingConsoleHandler`: not used
Moved from `autogpt` to `forge`:
- `autogpt.config` -> `forge.config`
- `autogpt.processing` -> `forge.content_processing`
- `autogpt.file_storage` -> `forge.file_storage`
- `autogpt.logs` -> `forge.logging`
- `autogpt.speech` -> `forge.speech`
- `autogpt.agents.(base|components|protocols)` -> `forge.agent.*`
- `autogpt.command_decorator` -> `forge.command.decorator`
- `autogpt.models.(command|command_parameter)` -> `forge.command.(command|parameter)`
- `autogpt.(commands|components|features)` -> `forge.components`
- `autogpt.core.utils.json_utils` -> `forge.json.parsing`
- `autogpt.prompts.utils` -> `forge.llm.prompting.utils`
- `autogpt.core.prompting.(base|schema|utils)` -> `forge.llm.prompting.*`
- `autogpt.core.resource.model_providers` -> `forge.llm.providers`
- `autogpt.llm.providers.openai` + `autogpt.core.resource.model_providers.utils`
-> `forge.llm.providers.utils`
- `autogpt.models.action_history:Action*` -> `forge.models.action`
- `autogpt.core.configuration.schema` -> `forge.models.config`
- `autogpt.core.utils.json_schema` -> `forge.models.json_schema`
- `autogpt.core.resource.schema` -> `forge.models.providers`
- `autogpt.models.utils` -> `forge.models.utils`
- `forge.sdk.(errors|utils)` + `autogpt.utils.(exceptions|file_operations_utils|validators)`
-> `forge.utils.(exceptions|file_operations|url_validator)`
- `autogpt.utils.utils` -> `forge.utils.const` + `forge.utils.yaml_validator`
Moved within `forge`:
- forge/prompts/* -> forge/llm/prompting/*
The rest are mostly import updates, and some sporadic removals and necessary updates (for example to fix circular deps):
- Changed `CommandOutput = Any` to remove coupling with `ContextItem` (no longer needed)
- Removed unused `Singleton` class
- Reluctantly moved `speech` to forge due to coupling (tts needs to be changed into component)
- Moved `function_specs_from_commands` and `core/resource/model_providers` to `llm/providers` (resources were a `core` thing and are no longer relevant)
- Keep tests in `autogpt` to reduce changes in this PR
- Removed unused memory-related code from tests
- Removed duplicated classes: `FancyConsoleFormatter`, `BelowLevelFilter`
- `prompt_settings.yaml` is in both `autogpt` and `forge` because for some reason doesn't work when placed in just one dir (need to be taken care of)
- Removed `config` param from `clean_input`, it wasn't used and caused circular dependency
- Renamed `BaseAgentActionProposal` to `ActionProposal`
- Updated `pyproject.toml` in `forge` and `autogpt`
- Moved `Action*` models from `forge/components/action_history/model.py` to `forge/models/action.py` as those are relevant to the entire agent and not just `EventHistoryComponent` + to reduce coupling
- Renamed `DEFAULT_ASK_COMMAND` to `ASK_COMMAND` and `DEFAULT_FINISH_COMMAND` to `FINISH_COMMAND`
- Renamed `AutoGptFormatter` to `ForgeFormatter` and moved to `forge`
Includes changes from PR https://github.com/Significant-Gravitas/AutoGPT/pull/7148
---------
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
Persist the agent's `AgentContext` so that it works in rehydrated agent instances. This makes context usable in the `AgentProtocolServer`, where the agent instance is loaded and destroyed for every step.
- Make `AgentContext` a Pydantic model
- Add `context` parameter to `ContextComponent.__init__` so we can pass in an existing instance
- Add `context: AgentContext` to `AgentSettings` so it is persisted
- Add `type` attribute to `ContextItem` implementations as a discriminator
- Rename `ContextItem` base class to `BaseContextItem` and make new `ContextItem` type alias (union of the implementation types)
Documentation files were in docs/content/AutoGPT/components, symlinks in autogpts/autogpt/autogpt/(agents|commands).
Chef doesn't allow symlinks that point to locations outside of package dir.
Replacing the documentation files with symlinks, and symlinks with the actual documentation files, should fix this.
- feat(agent/core): Add `AnthropicProvider`
- Add `ANTHROPIC_API_KEY` to .env.template and docs
Notable differences in logic compared to `OpenAIProvider`:
- Merges subsequent user messages in `AnthropicProvider._get_chat_completion_args`
- Merges and extracts all system messages into `system` parameter in `AnthropicProvider._get_chat_completion_args`
- Supports prefill; merges prefill content (if any) into generated response
- Prompt changes to improve compatibility with `AnthropicProvider`
Anthropic has a slightly different API compared to OpenAI, and has much stricter input validation. E.g. Anthropic only supports a single `system` prompt, where OpenAI allows multiple `system` messages. Anthropic also forbids sequences of multiple `user` or `assistant` messages and requires that messages alternate between roles.
- Move response format instruction from separate message into main system prompt
- Fix clock message format
- Add pre-fill to `OneShot` generated prompt
- refactor(agent/core): Tweak `model_providers.schema`
- Simplify `ModelProviderUsage`
- Remove attribute `total_tokens` as it is always equal to `prompt_tokens + completion_tokens`
- Modify signature of `update_usage(..)`; no longer requires a full `ModelResponse` object as input
- Improve `ModelProviderBudget`
- Change type of attribute `usage` to `defaultdict[str, ModelProviderUsage]` -> allow per-model usage tracking
- Modify signature of `update_usage_and_cost(..)`; no longer requires a full `ModelResponse` object as input
- Allow `ModelProviderBudget` zero-argument instantiation
- Fix type of `AssistantChatMessage.role` to match `ChatMessage.role` (str -> `ChatMessage.Role`)
- Add shared attributes and constructor to `ModelProvider` base class
- Add `max_output_tokens` parameter to `create_chat_completion` interface
- Add pre-filling as a global feature
- Add `prefill_response` field to `ChatPrompt` model
- Add `prefill_response` parameter to `create_chat_completion` interface
- Add `ChatModelProvider.get_available_models()` and remove `ApiManager`
- Remove unused `OpenAIChatParser` typedef in openai.py
- Remove redundant `budget` attribute definition on `OpenAISettings`
- Remove unnecessary `usage` in `OpenAIProvider` > `default_settings` > `budget`
- feat(agent): Allow use of any available LLM provider through `MultiProvider`
- Add `MultiProvider` (`model_providers.multi`)
- Replace all references to / uses of `OpenAIProvider` with `MultiProvider`
- Change type of `Config.smart_llm` and `Config.fast_llm` from `str` to `ModelName`
- feat(agent/core): Validate function call arguments in `create_chat_completion`
- Add `validate_call` method to `CompletionModelFunction` in `model_providers.schema`
- Add `validate_tool_calls` utility function in `model_providers.utils`
- Add tool call validation step to `create_chat_completion` in `OpenAIProvider` and `AnthropicProvider`
- Remove (now redundant) command argument validation logic in agent.py and models/command.py
- refactor(agent): Rename `get_openai_command_specs` to `function_specs_from_commands`
* Introduce `BaseAgentActionProposal`, `OneShotAgentActionProposal`, and `AssistantThoughts` models to replace `ThoughtProcessResponse`, `DEFAULT_RESPONSE_SCHEMA`
* Refactor and clean up code because now we don't need to do as much type checking everywhere
* Tweak `OneShot` response format instruction
Granular:
* `autogpt.agents.prompt_strategies.one_shot`
* Replace ThoughtProcessResponse`, `DEFAULT_RESPONSE_SCHEMA` and parsing logic by `AssistantThoughts` and `OneShotAgentActionProposal`
* (TANGENTIAL) Move response format instruction into main system prompt message
* (TANGENTIAL) Adjust response format instruction
* `autogpt.agents.base`
* Add `BaseAgentActionProposal` base model -> replace `ThoughtProcessOutput`
* Change signature of `execute` method to accept `BaseAgentActionProposal` instead of separate `command_name` and `command_args`
* Add `do_not_execute(proposal, feedback)` abstract method, replacing `execute("human_feedback", ..., feedback)`
* Move `history` definition from `BaseAgentSettings` to `AgentSettings` (the only place where it's used anyway)
* `autogpt.models`
* Add `.utils` > `ModelWithSummary` base model
* Make the models in `.action_history` (`Episode`, `EpisodicActionHistory`) generic with a type parameter for the type of `Episode.action`
* `autogpt.core.resource.model_providers.schema`
* Add `__str__` to `AssistantFunctionCall` which pretty-prints the function call
All other changes are a direct result of the changes above.
## BREAKING CHANGE:
* Due to the change in `autogpt.models.action_history`, the application after this change will be unable to load/resume agents from before this change and vice versa.
* The `additional_output` field in the response of `execute_step` has changed slightly:
* Type of `.thoughts.plan` has changed from `str` to `list[str]`
* `.command` -> `.use_tool`
* `.command.args` -> `.use_tool.arguments`
* Fix ImportError for validate_yaml_file function
* Fix ImportError for validate_yaml_file function
---------
Co-authored-by: suyun <sylearn@foxmail.com>
Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
### Background
Follow up after merging https://github.com/Significant-Gravitas/AutoGPT/pull/7054, old plugins will no longer be used.
### Changes 🏗️
- Removed all dead code needed to load and use plugins.
- Removed `auto-gpt-plugin-template` dependency
- Removed `rev=` from `autogpt-forge` dependency (the set `rev` had incompatible `duckduckgo-search` versions)
- Kept `--install-plugin-deps` CLI option and dead code associated (may be needed for new plugins)
* feat: add all the new component docs to the site
* fix(docs): relative links and markdown warnings
* feat(docs): How to contribute to the docs as a docs section
* fix(docs): missed docs page for developer setup
* fix(docs): re-add configurations options
* fix(docs): bad link to components fixed
* fix(docs): bad link to components fixed
* ref(docs): reorder some items to make more sense
* fix(docs): bad indentation and duplicate block
* fix(docs): warning about out of date markdown extension
* fix(docs): broken links fixed
* fix(docs): markdown formatter complaints
This incremental re-architecture unifies Agent code and plugins, so everything is component-based.
## Breaking changes
- Removed command categories and `DISABLED_COMMAND_CATEGORIES` environment variable. Use `DISABLED_COMMANDS` environment variable to disable individual commands.
- Changed `command` decorator; old-style commands are no longer supported. Implement `CommandProvider` on components instead.
- Removed `CommandRegistry`, now all commands are provided by components implementing `CommandProvider`.
- Removed `prompt_config` from `AgentSettings`.
- Removed plugin support: old plugins will no longer be loaded and executed.
- Removed `PromptScratchpad`, it was used by plugins and is no longer needed.
- Changed `ThoughtProcessOutput` from tuple to pydantic `BaseModel`.
## Other changes
- Created `AgentComponent`, protocols and logic to execute them.
- `BaseAgent` and `Agent` is now composed of components.
- Moved some logic from `BaseAgent` to `Agent`.
- Moved agent features and commands to components.
- Removed check if the same operation is about to be executed twice in a row.
- Removed file logging from `FileManagerComponent` (formerly `AgentFileManagerMixin`)
- Updated tests
- Added docs
See [Introduction](https://github.com/kcze/AutoGPT/blob/kpczerwinski/open-440-modular-agents/docs/content/AutoGPT/component%20agent/introduction.md) for more information.
- Set default values for `ProviderBudget` / `ModelProviderBudget` fields
- Remove redundant field redefinitions on `ModelProviderBudget` class
- Change `ModelProviderUsage.update_usage(..)` and `ModelProviderBudget.update_usage_and_cost(..)` signatures for easier use
- Change `ModelProviderBudget.usage` from `ModelProviderUsage` to `defaultdict[str, ModelProviderUsage]` for per-model usage tracking
- Fix `ChatModelInfo`/`EmbeddingModelInfo` `service` attribute: rename from `llm_service` to match base class and fix types.
This makes it unnecessary to specify the `service` field when creating a `ChatModelInfo` or `EmbeddingModelInfo` object.
- Use `defaultdict(ModelProviderBudget)` for task budget tracking in agent_protocol_server.py
* refactor(agent/core): Rearrange and split up `OpenAIProvider.create_chat_completion`
- Rearrange to reduce complexity, improve separation/abstraction of concerns, and allow multiple points of failure during parsing
- Move conversion from `ChatMessage` to `openai.types.ChatCompletionMessageParam` to `_get_chat_completion_args`
- Move token usage and cost tracking boilerplate code to `_create_chat_completion`
- Move tool call conversion/parsing to `_parse_assistant_tool_calls` (new)
* fix(agent/core): Handle decoding of function call arguments in `create_chat_completion`
- Amend `model_providers.schema`: change type of `arguments` from `str` to `dict[str, Any]` on `AssistantFunctionCall` and `AssistantFunctionCallDict`
- Implement robust and transparent parsing in `OpenAIProvider._parse_assistant_tool_calls`
- Remove now unnecessary `json_loads` calls throughout codebase
* feat(agent/utils): Improve conditions and errors in `json_loads`
- Include all decoding errors when raising a ValueError on decode failure
- Use errors returned by `return_errors` instead of an error buffer
- Fix check for decode failure
* Make `Agent.save_state` behave like "save as"
- Leave previously saved state untouched
- Save agent state in new folder corresponding to new `agent_id`
- Copy over workspace contents to new folder
* Add `copy` method to `FileStorage`
---------
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
Update web_search command for both autogpt and forge to adjust for breaking change in v5 of duckduckgo_search,
update duckduckgo_search to ^5.0.0
---------
Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
- Move filtering logic from tests/vcr/__init__.py to tests/vcr/vcr_filter.py
- Ignore all `X-Stainless-*` headers for cassette matching, e.g. `X-Stainless-OS` and `X-Stainless-Runtime-Version`
- Remove deprecated OpenAI proxy logic
- Reorder methods in vcr_filter.py for readability
* Better handle no API keys or invalid ones
* Handle exception and exit when invalid key is provided
* Handle any APIError exception when trying to get OpenAI models and exit
---------
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
* Matrix the AutoGPT Python CI's `test` job across Ubuntu, macOS and Windows
- Set up MinIO in a step rather than specifying it under `jobs[test].services`, because services are only supported on Linux runners
- Add Windows version of step to install Poetry
- Add macOS compatibility patches to 'Install Poetry (Unix)' and `setup_git_auth` steps
**Caveats:**
- **No Docker on macOS or Windows**
* Windows comes with Docker but only supports running Windows containers, while we're mainly interested in using Linux containers for code execution and/or running auxiliary services.
* [The macOS runner doesn't come with Docker](https://github.com/actions/runner-images/issues/17). Setting it up is possible but takes ~3-4 minutes, and the performance of the Colima engine is poor: a `docker pull` that takes 2 seconds on Linux takes 45 seconds on macOS.
- **No S3 service available on Windows**
It seems that running a background process [isn't possible on Windows](https://github.com/actions/runner/issues/598#issuecomment-2011890429), and neither is running Linux-based Docker containers.
* Add `autogpt-agent` and OS-specific flags to Codecov upload step
* Improve caching of Python dependencies in CI by changing the cache key
- Include hash of `poetry.lock` instead of `pyproject.toml` in key
- Remove date component from key; it was included to avoid getting stuck to old cached versions of packages when we were still using `requirements.txt`. With `poetry.lock` that is no longer a concern.
* Fix skip check in test_s3_file_storage.py
* Implement syntax fault tolerant `json_loads` function using `dem3json`
- Add `dem3json` dependency
* Replace `json.loads` by `json_loads` in places where malformed JSON may occur
* Move `json_utils.py` to `autogpt/core/utils`
* Add tests for `json_utils`
---------
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
- Replace `session.prompt_async(..)` with `click.prompt(..)` in `clean_input` (autogpt/app/utils.py)
- Convert `clean_input` back to a synchronous function (and amend its usages accordingly)
- Remove `prompt-toolkit` dependency
This mitigates issues crashes in some shell environments on Windows.
- Improve error output for failure to load plugin
- Fix logic to determine qualified module name
- Use `importlib` rather than `__import__` magic function
This unbreaks `scan_plugins` on Windows.
- Add `AgentFinished` exception (subclass of `AgentTerminated`)
- Raise `AgentFinished` instead of `AgentTerminated` in `finish` method
- Remove resumption patch from PR #6990 in `BaseAgent`
- Clean up implementation of `finish` in `AgentProtocolServer`
- Add resumption mechanism in `run_auto_gpt` (main.py)
Fix resume-related exceptions
- CLI: prevent resumed agent to register action on already existing one
- Server: prevent trying to json() command without result
* Rename `FileWorkspace` to `FileStorage`
- `autogpt.file_workspace` -> `autogpt.file_storage`
- `LocalFileWorkspace` -> `LocalFileStorage`
- `S3FileWorkspace` -> `S3FileStorage`
- `GCSFileWorkspace` -> `GCSFileStorage`
* Rename `WORKSPACE_BACKEND` to `FILE_STORAGE_BACKEND`
* Rename `WORKSPACE_STORAGE_BUCKET` to `STORAGE_BUCKET`
* Rewrite `AgentManager` to use `FileStorage` rather than direct local file access
* Rename `AgentManager.retrieve_state(..)` method to `load_agent_state`
* Add docstrings to `AgentManager`
* Create `AgentFileManagerMixin` to replace `AgentFileManager`, `FileWorkspaceMixin`, `BaseAgent.attach_fs(..)`
* Replace `BaseAgentSettings.save_to_json_file(..)` method by `AgentFileManagerMixin.save_state()`
* Replace `BaseAgent.set_id(..)` method by `AgentFileManagerMixin.change_agent_id(..)`
* Remove `BaseAgentSettings.load_from_json_file(..)`
* Remove `AgentSettings.agent_data_dir`
* Update `AgentProtocolServer` to work with the new `FileStorage` system and `AgentFileManagerMixin`
* Make `agent_id` and `file_storage` parameters for creating an Agent:
- `create_agent`, `configure_agent_with_state`, `_configure_agent`, `create_agent_state` in `autogpt.agent_factory.configurators`
- `generate_agent_for_task` in `autogpt.agent_factory.generators`
- `Agent.__init__(..)`
- `BaseAgent.__init__(..)`
- Initialize and pass in `file_storage` in `autogpt.app.main.run_auto_gpt(..)` and `autogpt.app.main.run_auto_gpt_server(..)`
* Add `clone_with_subroot` to `FileStorage`
* Add `exists`, `make_dir`, `delete_dir`, `rename`, `list_files`, `list_folders` methods to `FileStorage`
* Update `autogpt.commands.file_operations` to use `FileStorage` and `AgentFileManagerMixin` features
* Update tests for `FileStorage` implementations and usages
* Rename `workspace` fixture to `storage`
* Update conftest.py
Poetry recently released v1.8.x containing a fix for the issue we were having earlier:
https://github.com/python-poetry/poetry/issues/8548
This means unavailable optional directory dependencies no longer break the docker build.
* Fix unmasking of `azure_endpoint` in `OpenAICredentials.get_api_access_kwargs()`
* Amend `ApiManager.get_models` to use `AzureOpenAI` client when `api_type` is set to `azure`
---------
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
* By default, allow requests originating from http://localhost:{AP_SERVER_PORT} instead of all origins
* Allow configuring allowed CORS origins through `AP_SERVER_CORS_ALLOWED_ORIGINS`
* Mitigate shell injection in `MacOSTTS._speech` implementation
* Mitigate shell command control bypassing in `execute_shell` and `execute_shell_popen` commands
- Improve implementation and docstring of `validate_command` function
---------
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
- Rename build-frontend.yml to frontend-ci.yml
- Add a `pull_request` trigger
- Disable committing and pushing to a `frontend_build_{hash}` branch
- (Re)enable auto-creating a pull request for the new frontend build
We have been seeing `AttributeError: 'NoneType' object has no attribute 'split'` in Sentry.
According to https://github.com/SergeyPirogov/webdriver_manager/issues/649, this occurs
when Chrome is not installed, or when no suitable ChromeDriver version is available for
the installed version of Chrome.
Instead of the `AttributeError`, we can print a better message for the agent and user to help them fix the issue.
---
Co-authored-by: kcze <kpczerwinski@gmail.com>
OpenAI requires the `id` property on tool calls in assistant messages.
We weren't storing it in the `AssistantChatMessage` that is created from the LLM's response,
causing an error when adding those messages back to the prompt.
Fix:
* Add `id` to `AssistantToolCall` and `AssistantToolCallDict` types in model_providers/schema.py
* Amend `_tool_calls_compat_extract_calls` to generate an ID for extracted tool calls
---
Co-authored-by: kcze <kpczerwinski@gmail.com>
OpenAI likes neither `tool_calls=[]` nor `tool_calls=None`. If no `tool_calls` are in the message, the key must be omitted.
This partially reverts commit 67bafa6302.
---
Co-authored-by: kcze <kpczerwinski@gmail.com>
* In challenge specification, specify `subprocess.PIPE` for `stdin` and `stderr` for completeness
* Additional tweak: let Pytest load only the current file when running the test file as a script
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
In a `for item in list` loop, removing items from the list while iterating causes it to skip over the next item. Fix: refactor `interactively_revise_ai_settings` routine to use while loop for iterating over constraints, resources, and best practices.
---------
Co-authored-by: Kripanshu Jindal <polaris@Polaris.local>
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
The `report_subfolder` variable was being populated with two identical lines, because there will be two untracked files in the folder, resulting in the same dirname.
This caused later commands using that variable to fail. Fix is to `sort -u` before storing the value to `report_subfolder`.
`agbenchmark` currently creates files like success_rate.json in the base REPORTS_FOLDER, which causes conflicts in the last step of the benchmark workflow.
To prevent issues, these files must be removed prior to switching to the data branch.
Validation errors don't mention the values causing the error, making it hard to debug. This happened a few times in autogpts-benchmark.yml, so let's put this log statement here until we figure out what makes it crash.
- Added `task_cumulative_cost` and `task_total_cost` attributes to the `Step.additional_output` in the `AgentProtocolServer.execute_step` endpoint.
- Updated `agbenchmark` dependency in Agent and Forge
- Added `n_steps` attribute to `TestResult` type
- Added logic to record the number of steps to `BuiltinChallenge.test_method`, `WebArenaChallenge.test_method`, and `.reports.add_test_result_to_report`
- Add `challenge list` command with options `--all`, `--names`, `--json`
- Add `tabular` dependency
- Add `.utils.utils.sorted_by_enum_index` function to easily sort lists by an enum value/property based on the order of the enum's definition
- Add `challenge info [name]` command with option `--json`
- Add `.utils.utils.pretty_print_model` routine to pretty-print Pydantic models
- Refactor `config` subcommand to use `pretty_print_model`
- Reduce duplicate and nested statements
- Add `skip_unavailable` parameter
Related changes:
- Add `available` and `unavailable_reason` attributes to `ChallengeInfo` and `WebArenaChallengeSpec`
- Add `pytest.skip` statement to `WebArenaChallenge.test_method` to make sure unavailable challenges are not run
- Make `AgentBenchmarkConfig.reports_folder` directly configurable (through `REPORTS_FOLDER` env variable). The default is still `./agbenchmark_config/reports`.
- Change all mentions of `REPORT_LOCATION` (which fulfilled the same function at some point in the past) to `REPORTS_FOLDER`.
- Added a helper function `.app.utils.vcs_state_diverges_from_master()`. This function determines whether the relevant part of the codebase diverges from our `master`.
- Updated `.app.telemetry._setup_sentry()` to determine the default environment name using `vcs_state_diverges_from_master`.
- Added a helper function `wait_until_conn_ready(port)` to wait for the benchmark and agent applications to finish starting
- Improved the CLI's own logging (within the `agent start` command)
- Fixed `--mock` mode
- Moved interrupt to beginning of the step iterator pipeline (from `BuiltinChallenge` to `agent_api_interface.py:run_api_agent`). This ensures that any finish-up code is properly executed after executing a single step.
- Implemented mock mode in `WebArenaChallenge`
- Fixed `fixture 'i_attempt' not found` error when `--attempts`/`-N` is omitted
- Fixed handling of `python`/`pytest` evals in `BuiltinChallenge`
- Disabled left-over Helicone code (see 056163e)
- Fixed a couple of challenge definitions
- WebArena task 107: fix spelling of months (Sepetember, Octorbor *lmao*)
- synthesize/1_basic_content_gen (SynthesizeInfo): remove empty string from `should_contain` list
- Added some debug logging in agent_api_interface.py and challenges/builtin.py
OpenAI's newest models return JSON with markdown fences around it, breaking the `json.loads` parser.
This commit adds an `extract_list_from_response` function to json_utils/utilities.py and uses this function to replace `json.loads` in `_process_text`.
* Add Sentry integration for telemetry
- Add `sentry_sdk` dependency
- Add setup logic and config flow using `TELEMETRY_OPT_IN` environment variable
- Add app/telemetry.py with `setup_telemetry` helper routine
- Call `setup_telemetry` in `cli()` in app/cli.py
- Add `TELEMETRY_OPT_IN` to .env.template
- Add helper function `env_file_exists` and routine `set_env_config_value` to app/utils.py
- Add unit tests for `set_env_config_value` in test_utils.py
- Add prompt to startup to ask whether the user wants to enable telemetry if the env variable isn't set
* Add `capture_exception` statements for LLM parsing errors and command failures
- Change default `SMART_LLM` from `gpt-4` to `gpt-4-turbo-preview`
- Change default `FAST_LLM` from `gpt-3.5-turbo-16k` to `gpt-3.5-turbo-0125`
- Change default `EMBEDDING_MODEL` from `text-embedding-ada-002` to `text-embedding-3-small`
- Update .env.template, azure.yaml.template, and documentation accordingly
- Add `text-embedding-3-small` and `text-embedding-3-large` as `EMBEDDING_v3_S` and `EMBEDDING_v3_L` respectively
- Add `gpt-3.5-turbo-0125` as `GPT3_v4`
- Add `gpt-4-1106-vision-preview` as `GPT4_v3_VISION`
- Add GPT-4V models to info map
- Change chat model info mapping to derive info for aliases (e.g. `gpt-3.5-turbo`) from specific versions instead of the other way around
* Add `_sideload_chrome_extensions` subroutine to `open_page_in_browser` in web_selenium.py
* Sideloads uBlock Origin and I Still Don't Care About Cookies, downloading them if necessary
* Add 2-second delay to `open_page_in_browser` to allow time for handling cookie walls
Commit 956cdc7 "fix(agent/json_utils): Decode as JSON rather than Python objects" broke these unit tests because they generated "JSON" by stringifying a Python object.
* Compress steps in the prompt to reduce token usage, and to increase longevity when using models with limited context windows
* Move multiple copies of step formatting code to `Episode.format` method
* Add `EpisodicActionHistory.handle_compression` method to handle compression of new steps
* Implement `extract_information` function in `autogpt.processing.text` module. This function extracts pieces of information from a body of text based on a list of topics of interest.
* Add `topics_of_interest` and `get_raw_content` parameters to `read_webpage` commmand
* Limit maximum content length if `get_raw_content=true` is specified
* Replace `ast.literal_eval` with `json.loads` in `extract_dict_from_response`
This fixes a bug where boolean values could not be decoded because of their required capitalization in Python.
LLMs are probabilistic systems. Reproducibility of completions is not guaranteed. It only makes sense to account for this, by running challenges multiple times to obtain a success ratio rather than a boolean success/failure result.
Changes:
- Add `-N`, `--attempts` option to CLI and `attempts_per_challenge` parameter to `main.py:run_benchmark`.
- Add dynamic `i_attempt` fixture through `pytest_generate_tests` hook in conftest.py to achieve multiple runs per challenge.
- Modify `pytest_runtest_makereport` hook in conftest.py to handle multiple reporting calls per challenge.
- Refactor report_types.py, reports.py, process_report.ty to allow multiple results per challenge.
- Calculate `success_percentage` from results of the current run, rather than all known results ever.
- Add docstrings to a number of models in report_types.py.
- Allow `None` as a success value, e.g. for runs that did not render any results before being cut off.
- Make SingletonReportManager thread-safe.
* feat(benchmark): Add JungleGym WebArena challenges
- Add `WebArenaChallenge`, `WebArenaChallengeSpec`, and other logic to make these challenges work
- Add WebArena challenges to Pytest collection endpoint generate_test.py
* feat(benchmark/webarena): Add hand-picked selection of WebArena challenges
- Pydantic shallow-copies models when they are passed into a parent model, meaning they can't be updated through the original reference. This commit adds a fix for the resulting cost persistence issue.
- The `extract_dict_from_response` function, which is supposed to reliably extract a JSON object from an LLM's response, positively discriminated objects defined on a single line, causing issues.
- `summarize_text` and `QueryLanguageModel.__call__` still tried to access `response["content"]`, which isn't possible since upgrading to the OpenAI v1 client library.
- When an Artifact's file is modified by the agent, set its `agent_created` attribute to `True` instead of registering a new Artifact
- Update the `autogpt-forge` dependency to the newest version, in which `AgentDB.update_artifact` has been implemented
Squashed commit of the following:
commit 7d6476d329
Author: Reinier van der Leer <pwuts@agpt.co>
Date: Tue Jan 9 18:10:45 2024 +0100
refactor(benchmark/challenge): Set up structure to support more challenge providers
- Move `Challenge`, `ChallengeData`, `load_challenges` to `challenges/builtin.py` and rename to `BuiltinChallenge`, `BuiltinChallengeSpec`, `load_builtin_challenges`
- Create `BaseChallenge` to serve as interface and base class for different challenge implementations
- Create `ChallengeInfo` model to serve as universal challenge info object
- Create `get_challenge_from_source_uri` function in `challenges/__init__.py`
- Replace `ChallengeData` by `ChallengeInfo` everywhere except in `BuiltinChallenge`
- Add strong typing to `task_informations` store in app.py
- Use `call.duration` in `finalize_test_report` and remove `timer` fixture
- Update docstring on `challenges/__init__.py:get_unique_categories`
- Add docstring to `generate_test.py`
commit 5df2aa7939
Author: Reinier van der Leer <pwuts@agpt.co>
Date: Tue Jan 9 16:58:01 2024 +0100
refactor(benchmark): Refactor & rename functions in agent_interface.py and agent_api_interface.py
- `copy_artifacts_into_temp_folder` -> `copy_challenge_artifacts_into_workspace`
- `copy_agent_artifacts_into_folder` -> `download_agent_artifacts_into_folder`
- Reorder parameters of `run_api_agent`, `copy_challenge_artifacts_into_workspace`; use `Path` instead of `str`
commit 6a256fef4c
Author: Reinier van der Leer <pwuts@agpt.co>
Date: Tue Jan 9 16:02:25 2024 +0100
refactor(benchmark): Refactor & typefix report generation and handling logic
- Rename functions in reports.py and ReportManager.py to better reflect what they do
- `get_previous_test_results` -> `get_and_update_success_history`
- `generate_single_call_report` -> `initialize_test_report`
- `finalize_reports` -> `finalize_test_report`
- `ReportManager.end_info_report` -> `SessionReportManager.finalize_session_report`
- Modify `pytest_runtest_makereport` hook in conftest.py to finalize the report immediately after the challenge finishes running instead of after teardown
- Move result processing logic from `initialize_test_report` to `finalize_test_report` in reports.py
- Use `Test` and `Report` types from report_types.py where possible instead of untyped dicts: reports.py, utils.py, ReportManager.py
- Differentiate `ReportManager` into `SessionReportManager`, `RegressionTestsTracker`, `SuccessRateTracker`
- Move filtering of optional challenge categories from challenge.py (`Challenge.skip_optional_categories`) to conftest.py (`pytest_collection_modifyitems`)
- Remove unused `scores` fixture in conftest.py
commit 370d6dbf5d
Author: Reinier van der Leer <pwuts@agpt.co>
Date: Tue Jan 9 15:16:43 2024 +0100
refactor(benchmark): Simplify models in report_types.py
- Removed ForbidOptionalMeta and BaseModelBenchmark classes.
- Changed model attributes to optional: `Metrics.difficulty`, `Metrics.success`, `Metrics.success_percentage`, `Metrics.run_time`, and `Test.reached_cutoff`.
- Added validator to `Metrics` model to require `success` and `run_time` fields if `attempted=True`.
- Added default values to all optional model fields.
- Removed duplicate imports.
- Added condition in process_report.py to prevent null lookups if `metrics.difficulty` is not set.
- Update `openai` dependency from ^v0.27.10 to ^v1.7.2
- Update poetry.lock
- Update code for changed endpoints and new output types of OpenAI library
- Replace uses of `AssistantChatMessageDict` by `AssistantChatMessage`
- Update `PromptStrategy`, `BaseAgent`, and all of their subclasses accordingly
- Update `OpenAIProvider`, `OpenAICredentials`, azure.yaml.template, .env.template and test_config.py to work with new separate `AzureOpenAI` client
- Remove `_OpenAIRetryHandler` and implement retry mechanism with `tenacity`
- Rewrite pytest fixture `cached_openai_client` (renamed from `patched_api_requestor`) for OpenAI v1 library
* Update `openai` dependency from `^0.27.8` to `^1.7.2`
* Update `litellm` dependency from `^0.1.821` to `^1.17.9`
* Migrate llm.py from OpenAI module-level client to client instance
* Update return types in llm.py for new OpenAI and LiteLLM versions
* Also remove `Exception` as a return type because they are raised, not returned
* Update tutorials/003_crafting_agent_logic.md accordingly
Note: this changes the output types of the functions in `forge.llm`: `chat_completion_request`, `create_embedding_request`, `transcribe_audio`
* docs: Add documentation on how to use Agent Protocol in the template
- Added documentation on how to use Agent Protocol and its settings in the `.env.template` file.
- An explanation is provided for the `AP_SERVER_PORT` and `AP_SERVER_DB_URL` settings.
- This change aims to improve the understanding and usage of Agent Protocol in the project.
* docs: Update usage.md with information about configuring the API port
- Update the documentation for the `serve` mode in `usage.md`
- Add information about configuring the port for the API server using the `AP_SERVER_PORT` environment variable.
---------
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
When executing `port = os.getenv("PORT", 8000)` if the port is being fetched from a `.env` file it is fetched as a string.
This caused an error: `TypeError: 'str' object cannot be interpreted as an integer`
* refactor(benchmark): Deduplicate configuration loading logic
- Move the configuration loading logic to a separate `load_agbenchmark_config` function in `agbenchmark/config.py` module.
- Replace the duplicate loading logic in `conftest.py`, `generate_test.py`, `ReportManager.py`, `reports.py`, and `__main__.py` with calls to `load_agbenchmark_config` function.
* fix(benchmark): Fix type errors, linting errors, and clean up CLI validation in __main__.py
- Fixed type errors and linting errors in `__main__.py`
- Improved the readability of CLI argument validation by introducing a separate function for it
* refactor(benchmark): Lint and typefix app.py
- Rearranged and cleaned up import statements
- Fixed type errors caused by improper use of `psutil` objects
- Simplified a number of `os.path` usages by converting to `pathlib`
- Use `Task` and `TaskRequestBody` classes from `agent_protocol_client` instead of `.schema`
* refactor(benchmark): Replace `.agent_protocol_client` by `agent-protcol-client`, clean up schema.py
- Remove `agbenchmark.agent_protocol_client` (an offline copy of `agent-protocol-client`).
- Add `agent-protocol-client` as a dependency and change imports to `agent_protocol_client`.
- Fix type annotation on `agent_api_interface.py::upload_artifacts` (`ApiClient` -> `AgentApi`).
- Remove all unused types from schema.py (= most of them).
* refactor(benchmark): Use pathlib in agent_interface.py and agent_api_interface.py
* refactor(benchmark): Improve typing, response validation, and readability in app.py
- Simplified response generation by leveraging type checking and conversion by FastAPI.
- Introduced use of `HTTPException` for error responses.
- Improved naming, formatting, and typing in `app.py::create_evaluation`.
- Updated the docstring on `app.py::create_agent_task`.
- Fixed return type annotations of `create_single_test` and `create_challenge` in generate_test.py.
- Added default values to optional attributes on models in report_types_v2.py.
- Removed unused imports in `generate_test.py`
* refactor(benchmark): Clean up logging and print statements
- Introduced use of the `logging` library for unified logging and better readability.
- Converted most print statements to use `logger.debug`, `logger.warning`, and `logger.error`.
- Improved descriptiveness of log statements.
- Removed unnecessary print statements.
- Added log statements to unspecific and non-verbose `except` blocks.
- Added `--debug` flag, which sets the log level to `DEBUG` and enables a more comprehensive log format.
- Added `.utils.logging` module with `configure_logging` function to easily configure the logging library.
- Converted raw escape sequences in `.utils.challenge` to use `colorama`.
- Renamed `generate_test.py::generate_tests` to `load_challenges`.
* refactor(benchmark): Remove unused server.py and agent_interface.py::run_agent
- Remove unused server.py file
- Remove unused run_agent function from agent_interface.py
* refactor(benchmark): Clean up conftest.py
- Fix and add type annotations
- Rewrite docstrings
- Disable or remove unused code
- Fix definition of arguments and their types in `pytest_addoption`
* refactor(benchmark): Clean up generate_test.py file
- Refactored the `create_single_test` function for clarity and readability
- Removed unused variables
- Made creation of `Challenge` subclasses more straightforward
- Made bare `except` more specific
- Renamed `Challenge.setup_challenge` method to `run_challenge`
- Updated type hints and annotations
- Made minor code/readability improvements in `load_challenges`
- Added a helper function `_add_challenge_to_module` for attaching a Challenge class to the current module
* fix(benchmark): Fix and add type annotations in execute_sub_process.py
* refactor(benchmark): Simplify const determination in agent_interface.py
- Simplify the logic that determines the value of `HELICONE_GRAPHQL_LOGS`
* fix(benchmark): Register category markers to prevent warnings
- Use the `pytest_configure` hook to register the known challenge categories as markers. Otherwise, Pytest will raise "unknown marker" warnings at runtime.
* refactor(benchmark/challenges): Fix indentation in 4_revenue_retrieval_2/data.json
* refactor(benchmark): Update agent_api_interface.py
- Add type annotations to `copy_agent_artifacts_into_temp_folder` function
- Add note about broken endpoint in the `agent_protocol_client` library
- Remove unused variable in `run_api_agent` function
- Improve readability and resolve linting error
* feat(benchmark): Improve and centralize pathfinding
- Search path hierarchy for applicable `agbenchmark_config`, rather than assuming it's in the current folder.
- Create `agbenchmark.utils.path_manager` with `AGBenchmarkPathManager` and exporting a `PATH_MANAGER` const.
- Replace path constants defined in __main__.py with usages of `PATH_MANAGER`.
* feat(benchmark/cli): Clean up and improve CLI
- Updated commands, options, and their descriptions to be more intuitive and consistent
- Moved slow imports into the entrypoints that use them to speed up application startup
- Fixed type hints to match output types of Click options
- Hid deprecated `agbenchmark start` command
- Refactored code to improve readability and maintainability
- Moved main entrypoint into `run` subcommand
- Fixed `version` and `serve` subcommands
- Added `click-default-group` package to allow using `run` implicitly (for backwards compatibility)
- Renamed `--no_dep` to `--no-dep` for consistency
- Fixed string formatting issues in log statements
* refactor(benchmark/config): Move AgentBenchmarkConfig and related functions to config.py
- Move the `AgentBenchmarkConfig` class from `utils/data_types.py` to `config.py`.
- Extract the `calculate_info_test_path` function from `utils/data_types.py` and move it to `config.py` as a private helper function `_calculate_info_test_path`.
- Move `load_agent_benchmark_config()` to `AgentBenchmarkConfig.load()`.
- Changed simple getter methods on `AgentBenchmarkConfig` to calculated properties.
- Update all code references according to the changes mentioned above.
* refactor(benchmark): Fix ReportManager init parameter types and use pathlib
- Fix the type annotation of the `benchmark_start_time` parameter in `ReportManager.__init__`, was mistyped as `str` instead of `datetime`.
- Change the type of the `filename` parameter in the `ReportManager.__init__` method from `str` to `Path`.
- Rename `self.filename` with `self.report_file` in `ReportManager`.
- Change the way the report file is created, opened and saved to use the `Path` object.
* refactor(benchmark): Improve typing surrounding ChallengeData and clean up its implementation
- Use `ChallengeData` objects instead of untyped `dict` in app.py, generate_test.py, reports.py.
- Remove unnecessary methods `serialize`, `get_data`, `get_json_from_path`, `deserialize` from `ChallengeData` class.
- Remove unused methods `challenge_from_datum` and `challenge_from_test_data` from `ChallengeData class.
- Update function signatures and annotations of `create_challenge` and `generate_single_test` functions in generate_test.py.
- Add types to function signatures of `generate_single_call_report` and `finalize_reports` in reports.py.
- Remove unnecessary `challenge_data` parameter (in generate_test.py) and fixture (in conftest.py).
* refactor(benchmark): Clean up generate_test.py, conftest.py and __main__.py
- Cleaned up generate_test.py and conftest.py
- Consolidated challenge creation logic in the `Challenge` class itself, most notably the new `Challenge.from_challenge_spec` method.
- Moved challenge selection logic from generate_test.py to the `pytest_collection_modifyitems` hook in conftest.py.
- Converted methods in the `Challenge` class to class methods where appropriate.
- Improved argument handling in the `run_benchmark` function in `__main__.py`.
* refactor(benchmark/config): Merge AGBenchmarkPathManager into AgentBenchmarkConfig and reduce fragmented/global state
- Merge the functionality of `AGBenchmarkPathManager` into `AgentBenchmarkConfig` to consolidate the configuration management.
- Remove the `.path_manager` module containing `AGBenchmarkPathManager`.
- Pass the `AgentBenchmarkConfig` and its attributes through function arguments to reduce global state and improve code clarity.
* feat(benchmark/serve): Configurable port for `serve` subcommand
- Added `--port` option to `serve` subcommand to allow for specifying the port to run the API on.
- If no `--port` option is provided, the port will default to the value specified in the `PORT` environment variable, or 8080 if not set.
* feat(benchmark/cli): Add `config` subcommand
- Added a new subcommand `config` to the AGBenchmark CLI, to display information about the present AGBenchmark config.
* fix(benchmark): Gracefully handle incompatible challenge spec files in app.py
- Added a check to skip deprecated challenges
- Added logging to allow debugging of the loading process
- Added handling of validation errors when parsing challenge spec files
- Added missing `spec_file` attribute to `ChallengeData`
* refactor(benchmark): Move `run_benchmark` entrypoint to main.py, use it in `/reports` endpoint
- Move `run_benchmark` and `validate_args` from __main__.py to main.py
- Replace agbenchmark subprocess in `app.py:run_single_test` with `run_benchmark`
- Move `get_unique_categories` from __main__.py to challenges/__init__.py
- Move `OPTIONAL_CATEGORIES` from __main__.py to challenge.py
- Reduce operations on updates.json (including `initialize_updates_file`) outside of API
* refactor(benchmark): Remove unused `/updates` endpoint and all related code
- Remove `updates_json_file` attribute from `AgentBenchmarkConfig`
- Remove `get_updates` and `_initialize_updates_file` in app.py
- Remove `append_updates_file` and `create_update_json` functions in agent_api_interface.py
- Remove call to `append_updates_file` in challenge.py
* refactor(benchmark/config): Clean up and update docstrings on `AgentBenchmarkConfig`
- Add and update docstrings
- Change base class from `BaseModel` to `BaseSettings`, allow extras for backwards compatibility
- Make naming of path attributes on `AgentBenchmarkConfig` more consistent
- Remove unused `agent_home_directory` attribute
- Remove unused `workspace` attribute
* fix(benchmark): Restore mechanism to select (optional) categories in agent benchmark config
* fix(benchmark): Update agent-protocol-client to v1.1.0
- Fixes issue with fetching task artifact listings
gitpython was installed as an indirect dependency via agbenchmark. The release builds don't contain agbenchmark and thus also lack the gitpython package, which breaks the image.
- Move `auto-gpt-plugin-template` from dev dependencies to regular dependencies in `pyproject.toml`.
- Fixes#6566 - No module named 'auto_gpt_plugin_template'.
- Add logging to capture errors raised during execution of actions in the Agent
- Move `fmt_kwargs` function from `agent_protocol_server.py` to `logs/utils.py`
- Update the `read_file` function in `file_operations.py` to pass the file's extension to the `decode_textual_file` function.
- Modify the `decode_textual_file` function in `file_operations_utils.py` to accept the file extension as an argument.
- Update the `content` property in the `FileContextItem` class in `context_item.py` to pass the file's extension to the `decode_textual_file` function.
- Update the `test_parsers` function in `test_text_file_parsers.py` to pass the file extension to the `decode_textual_file` function.
- Prevent the Agent from treating `AgentTerminated` like it would any other exception raised by a command.
- The agent should raise AgentTerminated exception to exit the loop.
- Fix the parsing of invalid LLM responses by appending an error message to the prompt and allowing the LLM to fix its mistakes.
- Update the `OpenAIProvider` to handle the self-correction process and limit the number of attempts to fix parsing errors.
- Update the `BaseAgent` to profit from the new pasing and parse-fixing mechanism.
This change ensures that the system can handle and recover from errors in parsing LLM responses.
Hopefully this fixes#1407 once and for all.
- Updated the quick links and user guide URLs in the bulletin
- Released v0.5.0 with cloud-readiness, a new UI, support for the newest Agent Protocol version, and other improvements
See the release notes on Github for more details: https://github.com/Significant-Gravitas/AutoGPT/releases
- Removed unnecessary print_attribute calls in configurators.py and configurator.py files
- Consolidated printing of configuration attributes in main.py for improved readability and reduced log spam in Agent Protocol mode
- Update GCSFileWorkspace.initialize() to handle cases where the bucket doesn't exist and create it if necessary
- Add logging to S3FileWorkspace.initialize() and GCSFileWorkspace.initialize()
- Update GCSFileWorkspace.list() and S3FileWorkspace.list() to correctly handle nested paths and return the relative paths of files
- Fix tests for GCSFileWorkspace and S3FileWorkspace to account for the changes in initialization and listing behavior
- Fix S3FileWorkspace.open_file() to correctly switch between binary and text mode
- Added tests to verify the fixes in workspace initialization and listing behavior
- Fixes#6553 (`web_search` command not working)
- v3.x.x of the duckduckgo-search library no longer works, so updating to v4.0.0 unbreaks the `web_search` command
feat: Add dependencies required to use PostgreSQL
- Added psycopg2-binary version 2.9.9 to the dependencies in pyproject.toml
- Updated the poetry.lock file with the new package information
- Update the signature of `FileWorkspace.open_file` and fix implementations in every workspace backend
- Replace `open()` with `workspace.open_file` in the `read_file` command to use the workspace's file opening functionality
- Fix the parametrization of the `test_text_file_parsers` test to correctly test text file parsers
- Adjusted path processing and use of `agent.workspace` in the file_operations.py module to prevent double path resolution.
- Updated the `is_duplicate_operation` and `log_operation` functions in file_operations.py to use the `make_relative` argument of the `sanitize_path_arg` decorator.
- Refactored the `write_to_file`, `list_folder`, and `list_files` functions in file_operations.py to accept both string and Path objects as the path argument.
- Modified the GCSFileWorkspace and S3FileWorkspace classes in the file_workspace module to ensure that the root path is always an absolute path.
This commit addresses issues with path processing in the file_operations.py module and across different workspace backend implementations. The changes ensure that relative paths are correctly converted to absolute paths where necessary and that the file operations logic functions consistently handle path arguments as strings or Path objects. Additionally, the GCSFileWorkspace and S3FileWorkspace classes now enforce that the root path is always an absolute path.
- Remove X- prefix from X-AutoGPT-UserID, X-AP-TaskID, and X-AP-StepID headers
- Refactor literal references to "ask_user" to `ask_user.__name__` in AgentProtocolServer
- Fix type annotation for `agent_id` in `BaseAgentSettings` class
- Add assertion to ensure `agent_id` is not an empty string in `AgentManager.get_agent_dir()` method
- Change type of `override_name` and `override_role` to be optional in `apply_overrides_to_ai_settings()` function
- Update `AgentProtocolServer` to include `X-AP-TaskID` and `X-AutoGPT-UserID` headers in outgoing requests for Agent Protocol tasks.
- Modify `ModelProvider` and `OpenAIProvider` to allow configuring extra headers to be added to all outgoing requests.
- Fix the type of the `task_id` parameter in `AgentProtocolServer.get_task`
- Update the return type of the `AgentProtocolServer.get_artifact` method to `StreamingResponse`.
- Fix the Content-Disposition header in the response to include quotes around the filename.
- Fixed the persistence issue of additional_input and additional_output in the Step class in `forge.sdk`. The additional_input and additional_output attributes were not typed and initialized properly.
* refactor: Rename FileWorkspace to LocalFileWorkspace and create FileWorkspace abstract class
- Rename `FileWorkspace` to `LocalFileWorkspace` to provide a more descriptive name for the class that represents a file workspace that works with local files.
- Create a new base class `FileWorkspace` to serve as the parent class for `LocalFileWorkspace`. This allows for easier extension and customization of file workspaces in the future.
- Update import statements and references to `FileWorkspace` throughout the codebase to use the new naming conventions.
* feat: Add S3FileWorkspace + tests + test setups for CI and Docker
- Added S3FileWorkspace class to provide an interface for interacting with a file workspace and storing files in an S3 bucket.
- Updated pyproject.toml to include dependencies for boto3 and boto3-stubs.
- Implemented unit tests for S3FileWorkspace.
- Added MinIO service to Docker CI to allow testing S3 features in CI.
- Added autogpt-test service config to docker-compose.yml for local testing with MinIO.
* ci(docker): tee test output instead of capturing
* fix: Improve error handling in S3FileWorkspace.initialize()
- Do not tolerate all `botocore.exceptions.ClientError`s
- Raise the exception anyways if the error is not "NoSuchBucket"
* feat: Add S3 workspace backend support and S3Credentials
- Added support for S3 workspace backend in the Autogpt configuration
- Added a new sub-config `S3Credentials` to store S3 credentials
- Modified the `.env.template` file to include variables related to S3 credentials
- Added a new `s3_credentials` attribute on the `Config` class to store S3 credentials
- Moved the `unmasked` method from `ModelProviderCredentials` to the parent `ProviderCredentials` class to handle unmasking for S3 credentials
* fix(agent/tests): Fix S3FileWorkspace initialization in test_s3_file_workspace.py
- Update the S3FileWorkspace initialization in the test_s3_file_workspace.py file to include the required S3 Credentials.
* refactor: Remove S3Credentials and add get_workspace function
- Remove `S3Credentials` as boto3 will fetch the config from the environment by itself
- Add `get_workspace` function in `autogpt.file_workspace` module
- Update `.env.template` and tests to reflect the changes
* feat(agent/workspace): Make agent workspace backend configurable
- Modified `autogpt.file_workspace.get_workspace` function to either take a workspace `id` or `root_path`.
- Modified `FileWorkspaceMixin` to use the `get_workspace` function to set up the workspace.
- Updated the type hints and imports accordingly.
* feat(agent/workspace): Add GCSFileWorkspace for Google Cloud Storage
- Added support for Google Cloud Storage as a storage backend option in the workspace.
- Created the `GCSFileWorkspace` class to interface with a file workspace stored in a Google Cloud Storage bucket.
- Implemented the `GCSFileWorkspaceConfiguration` class to handle the configuration for Google Cloud Storage workspaces.
- Updated the `get_workspace` function to include the option to use Google Cloud Storage as a workspace backend.
- Added unit tests for the new `GCSFileWorkspace` class.
* fix: Unbreak use of non-local workspaces in AgentProtocolServer
- Modify the `_get_task_agent_file_workspace` method to handle both local and non-local workspaces correctly
* feat: Refactor config loading and initialization to be modular and decentralized
- Refactored the `ConfigBuilder` class to support modular loading and initialization of the configuration from environment variables.
- Implemented recursive loading and initialization of nested config objects.
- Introduced the `SystemConfiguration` base class to provide common functionality for all system settings.
- Added the `from_env` attribute to the `UserConfigurable` decorator to provide environment variable mappings.
- Updated the `Config` class and its related classes to inherit from `SystemConfiguration` and use the `UserConfigurable` decorator.
- Updated `LoggingConfig` and `TTSConfig` to use the `UserConfigurable` decorator for their fields.
- Modified the implementation of the `build_config_from_env` method in `ConfigBuilder` to utilize the new modular and recursive loading and initialization logic.
- Updated applicable test cases to reflect the changes in the config loading and initialization logic.
This refactor improves the flexibility and maintainability of the configuration loading process by introducing modular and recursive behavior, allowing for easier extension and customization through environment variables.
* refactor: Move OpenAI credentials into `OpenAICredentials` sub-config
- Move OpenAI API key and other OpenAI credentials from the global config to a new sub-config called OpenAICredentials.
- Update the necessary code to use the new OpenAICredentials sub-config instead of the global config when accessing OpenAI credentials.
- (Hopefully) unbreak Azure support.
- Update azure.yaml.template.
- Enable validation of assignment operations on SystemConfiguration and SystemSettings objects.
* feat: Update AutoGPT configuration options and setup instructions
- Added new configuration options for logging and OpenAI usage to .env.template
- Removed deprecated configuration options in config/config.py
- Updated setup instructions in Docker and general setup documentation to include information on using Azure's OpenAI services
* fix: Fix image generation with Dall-E
- Fix issue with image generation with Dall-E API
Additional user context: This commit fixes an issue with image generation using the Dall-E API. The code now correctly retrieves the API key from the agent's legacy configuration.
* refactor(agent/core): Refactor `autogpt.core.configuration.schema` and update docstrings
- Refactor the `schema.py` file in the `autogpt.core.configuration` module.
- Added docstring to `SystemConfiguration.from_env()`
- Updated docstrings for functions `_get_user_config_values`, `_get_non_default_user_config_values`, `_recursive_init_model`, `_recurse_user_config_fields`, and `_recurse_user_config_values`.
- Update the instruction in the prompt strategy to ensure the response is pure JSON.
- Remove unnecessary text and make the instruction clearer.
- Also update the error logging to include the received JSON content.
This commit refactors the code in the `one_shot.py` file and the `utilities.py` file.
- Update the pytest command in the .pre-commit-config.yaml file to use Poetry run instead of directly running pytest in the autogpts/autogpt directory.
- Refactored the `MemoryItem` class in the `autogpt.memory.vector.memory_item` module to improve code organization and readability.
- Split the `MemoryItem` class into two separate classes: `MemoryItem` and `MemoryItemFactory`.
- Modified the `get_embedding` function in the `autogpt.memory.vector.utils` module to accept an `EmbeddingModelProvider` for creating embeddings.
- Updated the usage of the `get_embedding` function in the `MemoryItem` class to pass the `embedding_provider` parameter.
- Updated the imports in the affected modules.
- Modify check_requirements.py to correctly handle optional dependencies
- Skip optional dependencies when iterating through dependence group dependencies in check_requirements.py
- Update autogpt.bat to use `poetry install` instead of `%PYTHON_CMD% -m poetry install`
- Update autogpt.sh to use `poetry install` instead of `$PYTHON_CMD -m poetry install`
- Use `poetry run` to execute the `autogpt` command in both scripts
- Update the reference to the VCR submodule in the autogpt tests
- Previous reference: 1896d8ac12ff1d27b7e9e5db6549abc38b260b40
- New reference: 9996f1d104a1e4f33c1e10aa664d01ea78db2a06
- Updated the `run` script to also check if `$OPENAI_API_KEY` is empty before copying `.env.example` and prompting the user to set API keys.
- Modified the `setup` script to install `--extras benchmark` separately from the initial `poetry install` command.
- Added `POETRY_INSTALLER_PARALLEL=false` flag to prevent conflicts between `forge` and `agbenchmark` during installation.
* Fix all but one flake8 linting errors
* Remove unused imports
* Wrap strings that are too long
* Add basic autogpts/autogpt/.flake8
* Delete planning_agent.py
* Delete default_prompts.py
* Delete _test_json_parser.py
* Refactor the example function call in AgentProfileGeneratorConfiguration from a string to an object
* Rewrite/update docstrings here and there while I'm at it
* Minor change to the description of the `open_file` command
* Use `user-agent` from config in web_selenium.py
* Delete hardcoded ABILITIES from core/planning/templates.py
* Delete duplicate and superseded test from test_image_gen.py
* Fix parameter definitions in mock_commands.py
* Delete code analysis blocks from test_spinner.py, test_url_validation.py
- Modify the test_url_validation_fails_local_path function to remove the specific match parameter and raise the ValueError without any match requirement.
- Update `test_config.py` to check if `config.smart_llm` starts with "gpt-4"
- Delete `test_retry_provider_openai.py` as it is no longer needed
- Update `test_url_validation.py` to properly test local file URLs
- Update `test_web_search.py` to assert against expected parts of output
- Refactor the `run_auto_gpt_server` function to make the Agent Protocol server database URL configurable.
- Use the `os.getenv` method to retrieve the database URL from the environment variable `AP_SERVER_DB_URL`.
- Created a new `LoggingConfig` class to represent the logging configuration in the `Config` class.
- Created a new `LogFormatName` enum to represent the available log formats: 'simple', 'debug', and 'structured_google_cloud'.
- Modified the `configure_logging` function to also accept an unpacked `LoggingConfig` object for arguments.
- Updated the `configure_logging` function to use the appropriate log format based on the log level.
- Added a `StructuredLoggingFormatter` class to handle formatting for structured logs.
- Updated the import statements and usages of `configure_logging` etc. in relevant modules to reflect the changes.
- Updated the `config` fixture in the unit tests to include the new logging configuration attributes.
- Updated the CLI with new parameters for log level and format.
- Reordered the parameters of the CLI.
- Removed memory related parameter from CLI.
- Remove the unused debug argument from the functions `inspect_zip_for_modules`, `initialize_openai_plugins`, `instantiate_openai_plugin_clients`, and `scan_plugins`.
- The debug argument was not being used in these functions and was unnecessary.
- Added information about the workspace folder in the AutoGPT user guide
- Clarified that files outside the workspace folder are inaccessible unless RESTRICT_TO_WORKSPACE is set to False. Provided a warning against disabling RESTRICT_TO_WORKSPACE unless in a sandbox environment.
- Update the `RESTRICT_TO_WORKSPACE` variable in `.env.template` to use the new workspace location
- Update the `.gitignore` files to remove the old workspace directory
- Update the `voice.md` file in the documentation to reflect the new command for speech mode
- Renamed `run.sh` to `autogpt.sh` for consistent naming and easier command usage.
- Updated relevant documentation to reflect the new entrypoint name.
- Adjusted the Docker setup for AutoGPT to expose the full CLI and allow access to the Agent Protocol Server's port.
- Updated the AutoGPT+Docker guide in the documentation to reflect the changes.
Changes made:
- In the `Dockerfile`, removed the `--install-plugin-deps` option from the `ENTRYPOINT` command.
- In the `docker-compose.yml` file, added the `ports` section to expose port `8000`.
- In the `pyproject.toml` file, changed the `run` script to `autogpt.app.cli:cli`.
- In the `docker.md` file, added instructions for the new Docker setup and updated the configuration steps.
- Added a new section to the documentation about the project CLI
- Provided an overview of the CLI and its usage
- Included common commands and their descriptions
- Updated the link to OpenAI API key page in the setup guide
- Fixed formatting issues in the usage guide
- Updated the link to the `.env.template` file in the usage guide
- Fixed formatting and wording issues in the index page
* README.md
- Mark evo.ninja as hackathon winner and new Current Best Agent.
- Remove hackathon banner.
- Rewrite sections about Forge, Benchmark, UI, Agent Protocol.
- Add sections about Leaderboard and CLI.
- Add quick links for improved user navigation, including links to documentation, contributing guidelines, and quickstart guide.
- Remove Quickstart.
* docs.agpt.co
- Removed links to outdated pages from navbar.
- Added quick links to several pages.
- Refactored and updated titles in docs site navbar for better readability and consistency.
- Rewrite intros on homepage to be more clear and professional and less cringe-worthy.
- Fix broken links.
- Rewrote setup and usage guides for AutoGPT Agent.
- Removed mentions of Azure support, except in the Docker guide.
- Added page with general information about AutoGPT.
* CONTRIBUTING.md
- Make CONTRIBUTING.md more friendly and accessible: added link to public kanban board, encouraged collaboration, removed section about net-negative PRs.
* autogpt/README.md
- Update description of AutoGPT to mention "modern Large Language Models" instead of GPT-4.
- Add quick links for improved user navigation, including links to documentation and contributing guidelines.
- Add features and setup guide: Agent Protocol, UI features, setup instructions, configuration options, Quickstart, CLI instructions, Agent Protocol server instructions, additional resources (wiki, project board, roadmap), and a note on sustainable development.
- Update links: documentation, setup instructions.
- Remove outdated Twitter accounts section.
- Modify the check_local_file_access function to only check for local file prefixes and return True if the URL starts with any of them.
- Remove the section of code that parsed the URL and checked if the hostname was in a list of local domains.
This change fixes the URL validation in the validators.py file. Previously, only local domains were allowed. After the change, non-local domains are allowed again.
(Note: this change was made in response to PR #5318 where the validation was modified to allow more local domains, but also accidentally to block any non-local domain.
- Removed Discord, GitHub stars, and Twitter follow badges
- Removed funding and sponsor sections
- Removed contributor and sponsor avatars
- Removed unnecessary line breaks and div tags
Without that step, there is an error:
"ModuleNotFoundError: No module named
'auto_gpt_plugin_template'"
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
* ci: Mitigate security issues in autogpt-ci.yml
- Remove unnecessary pull_request_target paths and related variables and config
- Set permissions for contents to read only
* ci: Simplify steps in autogpt-ci.yml workflow using GitHub CLI
- Simplify step in 'autogpt-ci.yml' by using GitHub CLI instead of API for adding label and comment functionality
- Replace curl command with 'gh issue edit' to add "behaviour change" label to the pull request
- Replace gh api command with 'gh issue comment' to leave a comment about the changed behavior of AutoGPT in the pull request
* ci: Fix issues in workflows
- Move environment variable definition to top level in benchmark-ci.yml (because the other job also needs it)
- Removed invalid 'branches: [hackathon]' restriction in hackathon.yml workflow
- Removed redundant 'ref' and 'repository' fields in the 'checkout' step of both workflows.
* ci: Delete legacy benchmarks.yml workflow
* ci: Add triggers for CI workflows
- Add triggers to run CI workflows when they are edited.
- Update the paths for the CI workflows in the trigger configuration.
* fix: Fix benchmark lint error
- Removed unnecessary blank lines in report_types.py
- Fixed string quotes in challenge.py to maintain consistency
* fix: Update task description in password generator data.json
- Update task description in `data.json` file for the password generator challenge to clarify the input requirements and error handling.
- This change is made in an attempt to make the Benchmark CI pass.
* fix: Fix PasswordGenerator challenge in CI
- Fix the behavior of the reference password_generator.py to align with the task description
- Use default password length 8 instead of a random length in the generate_password function
- Retrieve the password length from the command line arguments if "--length" is provided, else set it to 8
* Adding More Info To The Docs
* Start of main page rebuild and adding new folders
* Starting to move the AutoGPT(agent) Docs to a subfolder and start setup forge's subfolder
* small fixes in links
* fix file name
* added the benchmakrs page
* added front-end page
* re-aranging the layout
* moved the config section to be under the AutoGPT folder
* fix image link
* moved "Share Logs" and "Testing" to be under the AutoGPT folder
* index.md: fix broken links on home page
* Index.md: Testing Something with the links
* index.md: Added the Benchmarks section
* small fix for Frontend
* Added a chat ai to the docs for testing as part of #5694
* index.md: sepetating the sections and making it easier to read
* index.md: Added discord Link
* index.md: Added better info to each section from @Yash-Ambekar
* index.md: trying to fix the layout
* Index.md: updating layout
* Move Docker Setup To Its Own File
* small fix
* seperating the installation setups to there own page for making things clear
* small fix in links
* fix links again
* change nav titles color to help make things clear
* fix css
* mv custom.css
* fix for css not working
* rm custom css as it didnt work
* fix img
* update image url
* update nav
* index.md: improving layout and wordings
* index.md: testing line breaks
* index.md: Fixed the line breaks
* setup/docker-setp.md: small fix
* Docker-setup.md update link to correct memory page
* docker-setup.md: added note about docker install being broken
* Docker-Setup.md: Updating the warning
* Docker-Setup.md : Test
* docker-setup.md: fix
* docker-setup.md: fix
* docker-setup.md final update to the warning
* Docker-Setup.md
* Updates to mkdocs.yml and docker-setup based on the feedback
* fix to docker-setup.md
* docker-setup.md fix
* introduction.md: fix
* Update docs/content/AutoGPT/Setups/Docker-setup.md
Co-authored-by: Andy Hooker <58448663+andrewhooker2@users.noreply.github.com>
* docker-setup.md update link
* Update docs/content/AutoGPT/Setups/Git-setup.md
Co-authored-by: Andy Hooker <58448663+andrewhooker2@users.noreply.github.com>
* Update docs/content/AutoGPT/Setups/Git-setup.md
Co-authored-by: Andy Hooker <58448663+andrewhooker2@users.noreply.github.com>
* nogit-setup.md: updated links
* Update docs/content/AutoGPT/Setups/Git-setup.md
Co-authored-by: Andy Hooker <58448663+andrewhooker2@users.noreply.github.com>
* Update docs/content/index.md
Co-authored-by: Andy Hooker <58448663+andrewhooker2@users.noreply.github.com>
* Update docs/content/index.md
Co-authored-by: Andy Hooker <58448663+andrewhooker2@users.noreply.github.com>
* Update docs/content/index.md
Co-authored-by: Andy Hooker <58448663+andrewhooker2@users.noreply.github.com>
* Update docs/content/index.md
Co-authored-by: Andy Hooker <58448663+andrewhooker2@users.noreply.github.com>
* setup.md: added extra info about the docker insall
* setup.md small changs to clean things up
* removed emojis from forge get-started.md
* get-started.md - small changes
* Update AutoGPT intro in index.md
---------
Co-authored-by: sohamtembhurne <sohamatembhurne@outlook.com>
Co-authored-by: Yash-Ambekar <yashambekar03@gmail.com>
Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
Co-authored-by: Andy Hooker <58448663+andrewhooker2@users.noreply.github.com>
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
- Update `big_brain` attribute in `BaseAgentConfiguration` to default to `True`.
- This change disables hybrid mode in AutoGPT, making it use the configured smart LLM for thinking.
* feat: Add support for new models and features from OpenAI's November 6 update
- Updated the `OpenAIModelName` enum to include new GPT-3.5 Turbo and GPT-4 models
- Added support for the `GPT3_v3` and `GPT4_v3` models in the `OPEN_AI_CHAT_MODELS` dictionary
- Modified the `OpenAIProvider` class to handle the new models and features
- Updated the schema definitions in the `schema.py` module to include `AssistantToolCall` and `AssistantToolCallDict`
models
- Updated the `AssistantChatMessage` and `AssistantChatMessageDict` models to include the `tool_calls` field
- Refactored the code in various modules to handle the new tool calls and function arguments
Added support for the new models and features introduced with OpenAI's latest update. This commit allows the system to utilize the `GPT3_v3` and `GPT4_v3` models and includes all necessary modifications to the codebase to handle the new models and associated features.
* Fix validation error in LLM response handling
* fix: Fix profile generator in-prompt example for functions compatibility mode
- Updated the in-prompt example in the profile generator to be compatible with functions compatibility mode.
- Modified the example call section to correctly reflect the structure of function calls.
- Make minor adjustments to prompts in the OneShotAgentPromptConfiguration class
- Enhance the output format of the execute_result in AgentProtocolServer
- Update the key name from "criticism" to "self_criticism" in print_assistant_thoughts function
- Modify the output format of the web search results in the web_search function
- Updated `agent.py` to check if `command_name` exists before registering an action in `event_history`.
- Updated `agent_protocol_server.py` to handle the scenario when `execute_command` is not provided by LLM.
- Updated `main.py` to check if `command_name` exists before executing the command and logging the result.
The improved regex was introduced with
https://github.com/Significant-Gravitas/AutoGPT/pull/6096
However, there seems to be an issue with the updated regex;
The uppercase meta-character `\W` only matches non-word characters,
i.e. everything that is NOT [A-Za-z0-9_].
What you actually want is to use the lowercase `\w` character.
Co-authored-by: Simon Rummert <09.milieu.motes@icloud.com>
- Added logic to display a temporary chat message while waiting for the response from the agent.
- When a user sends a message, a temporary chat message is created and displayed.
- Implemented a method to remove the temporary chat message when the response is received or in case of an error.
- Updated the UI to invoke the method for adding a temporary chat message when the send button is pressed.
Feedback:
- This change improves the user experience by allowing them to see their own message immediately while waiting for the response from the agent.
- Added a boolean property `isWaitingForAgentResponse` to the `TaskViewModel` class to track whether a task is being created and waiting for a response from the agent.
- When a task is being created, we set `isWaitingForAgentResponse` to `true` and notify the listeners.
- When the task creation process is completed (successfully or not), `isWaitingForAgentResponse` is set to `false` and listeners are notified.
- Updated the `ChatView` class to listen to changes in `TaskViewModel.isWaitingForAgentResponse` to show the loading indicator conditionally.
- Updated the regular expression pattern to include matching fenced code blocks in addition to headers.
- Set the `dotAll` parameter to `true` to match across multiple lines in the regular expression.
- Wrapped the message container with a `SingleChildScrollView` widget to enable scrolling when the message content exceeds the available space.
- Implemented logic to conditionally render the message as markdown or selectable text based on the value of `hasMarkdown`.
- Modified the `MarkdownStyleSheet` to customize the appearance of blockquotes and code blocks.
- Updated the child widget of the message container to reflect the changes.
- Create a unique container name based on agent ID
- Check if the container with the name exists, otherwise create a new container
- If the container is not running, start it; otherwise, restart it
- Execute the code in the container
- Return the output of the code execution
This change enables reusing the same container for consecutive code execution commands, allowing for iterative changes to the execution environment.
Note: This change also includes handling the case where the Docker image is not found locally by pulling it from Docker Hub. The image used in this case is "python:3-alpine".
- Change `ErrorInfo` class attribute `_repr` to `repr` for consistent serialization
- Update `__repr__` method to return `self.repr` instead of `self._repr`
- Replaced `error` field in `ActionErrorResult` with `ErrorInfo` model.
- Implemented `ErrorInfo` model with necessary fields (`args`, `message`, `exception_type`, `_repr`).
- Added `from_exception` method to `ErrorInfo` model to create an instance from an Exception object.
- Updated `ActionErrorResult.from_exception` method to utilize `ErrorInfo.from_exception`.
- Ensured that `ActionErrorResult` is now fully serializable and won't cause crashes.
- Made necessary changes in code comments and documentation.
This commit fixes crashes caused by attempted serialiation of `AgentException` objects in the `ActionHistory` (as part of `ActionErrorResult`s). To this end, it introduces a new `ErrorInfo` model to encapsulate information about the exception, including the exception type, message, arguments, and representation. The `from_exception` method is added to both `ActionErrorResult` and `ErrorInfo` to create an `ActionErrorResult` object from an exception, extracting the relevant information.
- Update the logic for checking if an agent name already exists to be case-insensitive.
- Update the error message when an agent with the same name already exists to specify that the name should be unique regardless of case.
- Implement `containsMarkdown` function to identify messages with Markdown
- Utilize `flutter_markdown` package to render detected Markdown content
- Enhance chat UI to conditionally display plain text or formatted Markdown
This commit introduces enhancements to the project's documentation, specifically targeted at Windows users who may encounter issues post installing WSL. The added content aims to facilitate a smoother setup experience by providing clear and concise solutions to common problems encountered during the installation process.
Main Changes:
- Instructions on updating WSL for resolving initial setup issues.
- Solutions to fix ‘FileNotFoundError’ or ‘No such file or directory’ errors by addressing line-ending discrepancies between Windows and Unix/Linux systems.
- Recommendations to store project files within the WSL file system for avoiding issues related to path translations and permissions.
These changes are derived from personal experiences and are intended to prevent Windows users from spending additional time troubleshooting issues already resolved, allowing them to have a more consistent development environment setup.
Lastly, a big shout-out to the developers and contributors for their ongoing efforts and commitment to maintaining and improving this project. Your hard work is greatly appreciated by the community!
This commit addresses a UI issue where the ListView items were overlapping with the Positioned widget in the TaskQueueView. The Positioned widget has been replaced with a more flexible layout using a Column widget to ensure proper spacing and positioning of elements on the screen. The ListView now takes up all available space above the buttons, preventing any overlap and enhancing the user experience.
fixed issue with prompt instruction stacking
prompt instructions were stacking making the agent eventually return an error because the prompt was full of repeating instructions
A new property named _isWaitingForAgentResponse has been introduced to the ChatViewModel class to track the loading state when waiting for the agent's response. This boolean property is set to true when a chat message is being sent and reverts to false upon completion, whether successful or not. The notifyListeners() method is invoked to update the UI accordingly. This enhancement facilitates the display of a loading indicator, offering users visual feedback during the wait time for agent responses.
Implemented a new LoadingIndicator widget that displays a pulsating gradient line, giving users visual feedback during asynchronous operations such as API calls. The indicator animates a gradient from white to AppColors.primaryLight and back to the grey background color, signifying the loading state.
- Enhanced the `Chat` model to include an `artifacts` field to hold associated artifacts.
- Updated the `AgentMessageTile` widget to display the number of artifacts and added functionality to trigger artifact downloads upon button press.
- Introduced a method in `ChatViewModel` to leverage the `ChatService` for artifact downloads.
* AutoGPT: fix execution of async commands
* AutoGPT: Move all the Agent's prompt building code into OneShotAgentPromptStrategy
* Remove generic type annotations from PromptStrategy
* Fix tests
* Fix lint
This commit updates the Leaderboard Submission Dialog to pass the team name, repository URL, and commit SHA as parameters to the submitToLeaderboard function in the SkillTreeViewModel. These changes ensure that the dialog and the ViewModel are aligned in terms of parameter requirements, facilitating efficient and accurate leaderboard submissions.
This commit incorporates significant enhancements to the SkillTreeViewModel, introducing the ability to track current benchmark runs and submit results to the leaderboard. A new list, `currentBenchmarkRuns`, is introduced to store each benchmark run object during a specific benchmark session. This list is reset to an empty state when initiating a new benchmark.
Changes made:
- Introduced `currentBenchmarkRuns` to track ongoing benchmark runs, ensuring real-time data availability.
- Enhanced `runBenchmark` method to populate `currentBenchmarkRuns` with benchmark run objects as the benchmark progresses.
- Implemented `submitToLeaderboard` method, accepting parameters `teamName`, `repoUrl`, and `agentGitCommitSha`, and updating each run object with this information. All runs share a common UUID generated at the beginning of the submission process.
These enhancements ensure that benchmark run data is readily available and organized, facilitating a streamlined process for submitting well-structured data to the leaderboard. It fosters a more interactive and informative user experience, offering insights into each benchmark run's progress and outcomes.
This commit integrates the newly created UriUtility class into the LeaderboardSubmissionDialog. The isURL method from UriUtility is used to add an additional layer of validation for the GitHub repository URL input field. It ensures that users enter a valid URL format before submitting their leaderboard entries.
Changes made:
- Integrated UriUtility’s isURL method in the _validateAndSubmit function of the LeaderboardSubmissionDialog.
- Added a specific error message "Invalid URL format" to inform users when the entered URL does not meet the validation criteria.
- Updated the state management to reflect the URL validation status and re-render the dialog with appropriate error messages when necessary.
With this integration, the application now provides real-time feedback on the validity of the entered URL, enhancing user experience and data integrity by ensuring that only valid URLs are submitted to the leaderboard.
This commit introduces the UriUtility class to the codebase. This utility class contains a static method, isURL, used for validating URLs. The method checks for common URL validation criteria, ensuring that the input string adheres to the standard URL format. It verifies that the URL is non-empty, does not contain invalid characters, is not a mailto link, can be parsed as a URI, and has both a scheme and a host. Additional validations include checks on user info and port numbers.
Changes made:
- Created UriUtility class with isURL static method for URL validation.
- Included validations for empty strings, invalid characters, mailto links, scheme, host, user info, and port numbers.
- The utility will be utilized in forms and other areas where URL validation is necessary.
This enhancement improves the robustness of URL validation across the application, ensuring that only valid URLs are processed and stored.
Enhanced the RestApiUtility class to support HTTP PUT requests. The new method, `put`, allows for updating data at a specified endpoint. This addition provides more comprehensive CRUD operations for the API interactions, ensuring the client can perform updates when necessary.
Refactored the TaskService and TaskViewModel classes to fully support paginated fetching of tasks. The solution fetches tasks page by page until all tasks have been retrieved, accommodating the API's pagination mechanism. Renamed `listAllTasks` to `fetchTasksPage` to better reflect its purpose and introduced a new method, `fetchAllTasks`, to handle the paginated fetching logic.
Integrated both the TestSuiteButton and LeaderboardSubmissionButton in the TaskQueueView. Added conditions to disable the LeaderboardSubmissionButton based on benchmark running status and if the benchmarkStatusMap is empty. The onPressed logic for both buttons has been integrated as per requirements.
Added a new LeaderboardSubmissionButton widget to facilitate user submissions to the leaderboard. The button is styled consistently with other application buttons and features an emoji trophy icon to indicate leaderboard submissions. It provides a mechanism for disabling submissions based on certain conditions.
Introduced a new reusable TestSuiteButton widget. It provides flexibility for positioning and is intended for initiating the test suite in the TaskQueueView.
Introduce the LeaderboardSubmissionDialog widget which allows users to submit their team name, GitHub repo URL, and commit SHA for leaderboard consideration.
Features:
- Field validation: Ensure that all required fields are filled before submission.
- SharedPreferences integration: Save the user's last submission values and auto-populate the fields with these values when the dialog is shown next time.
This enhancement provides a smoother user experience by reducing repetitive data entry for subsequent leaderboard submissions.
- Introduced a new dialog, ContinuousModeDialog, to inform users about the repercussions of the continuous mode.
- Integrated ContinuousModeDialog with ChatInputField. The dialog is shown when the fast-forward icon is clicked, based on the user's shared preferences.
- Leveraged shared preferences to remember if the user has chosen not to see the dialog again.
- Enhanced the ChatInputField to handle different states and user interactions related to continuous mode.
- Introduced a new `SkillTreeType` enum to represent different skill tree categories: General, Coding, Data, and Scrape/Synthesize.
- Extended the `SkillTreeType` enum to provide associated string values and JSON file names for each category.
- Refactored the `SkillTreeViewModel` to reload the skill tree data based on the selected category.
- Enhanced `SkillTreeView` by adding a positioned dropdown in the top-left corner to allow users to select and load different skill tree categories dynamically.
Introduced a `AppColors` class to house all color constants provided by the design team. This class segregates colors into light and dark modes, ensuring easy and consistent theming throughout the application. The centralized approach simplifies updates and ensures color consistency across the app.
Added a FeatureFlags utility class to manage feature toggling within the application. This initial commit introduces a flag for the userExperienceIterationTwo feature, allowing for controlled testing and phased rollout as development progresses. The flag can be manually adjusted as needed.
- Deprecated `ApiSettingsViewModel` in favor of enhancing `SettingsViewModel`.
- Moved the API Base URL field from `TaskView` to `SettingsView` to centralize configuration.
- Integrated `RestApiUtility` dependency into `SettingsViewModel` to ensure consistent URL management across the app.
Refactored the ChatViewModel's sendChatMessage method to utilize the continuousModeSteps setting from the SettingsViewModel. This allows the continuous chat mode to honor the user's preference from the settings. Also introduced an optional currentStep parameter with a default value, enabling better control over the progression of continuous mode.
Changed the architecture of the SettingsView to align with the existing pattern in the application. Instead of creating its own instance of SettingsViewModel, the view now accepts an external viewModel as a parameter. This ensures consistency across the application and allows for better modularity and reusability of components.
This commit enriches the `SettingsViewModel` by integrating state persistence functionality and a sign-out method, thus ensuring a more robust and user-friendly settings feature.
Key Enhancements:
1. **State Persistence**:
- Leveraging the `shared_preferences` package, the app now stores and retrieves user preferences related to app settings, ensuring consistency across app restarts.
- Preferences like Dark Mode, Developer Mode, Base URL, and Continuous Mode Steps are persistently stored and loaded when the ViewModel is initialized.
2. **Sign Out Method**:
- A `signOut` method has been introduced in the ViewModel, utilizing the `AuthService` to facilitate user sign-out processes.
- This addition allows for seamless integration of sign-out functionality within the settings interface, granting users the ability to easily terminate sessions.
3. **SettingsView Enhancement**:
- The `SettingsView` has been adapted to incorporate a UI element invoking the `signOut` method, enhancing user interaction within the settings environment.
This enhancement not only bolsters the resilience and usability of the app’s settings but also lays down a structured approach for potential future additions to user preferences and settings-related functionalities.
This commit integrates the newly created `SettingsView` into the `MainLayout`, allowing users to access and interact with the settings through the main user interface of the app. When the user selects the settings tab from the `SideBarView`, the `SettingsView` is displayed alongside the `ChatView`, maintaining consistent layout aesthetics with other views like `TaskView`.
Key Changes:
- A new condition has been added in the `ValueListenableBuilder` within the `MainLayout` to check if the selected view is `'SettingsView'`.
- When `'SettingsView'` is selected, `SettingsView` is rendered with the same width as `TaskView`, and `ChatView` is displayed next to it.
- The state of the skill tree is reset when navigating to `SettingsView` to ensure a clean state.
This integration ensures a seamless user experience, allowing users to navigate and configure app settings easily and efficiently from the main layout of the app.
This commit augments the `SideBarView` by introducing a new `IconButton` that represents a tab for the newly created `SettingsView`. This enhancement allows users to navigate to the settings page directly from the sidebar, improving accessibility to app configuration options.
Key Changes:
- A new `IconButton` with a settings icon has been added to the sidebar’s `Column` widget.
- Selecting the settings tab updates the `selectedViewNotifier.value` to `'SettingsView'`, indicating the user's intent to navigate to the settings page.
- Visual feedback is provided by altering the color of the settings icon based on whether the settings tab is currently selected.
This addition ensures seamless integration of the `SettingsView` into the existing navigation structure, enabling users to easily configure app settings.
This commit refines the `populateSelectedNodeHierarchy` method in the `SkillTreeViewModel` to accurately represent nodes that possess multiple parent nodes, ensuring a comprehensive and non-redundant representation of the entire hierarchy leading back to the root nodes.
Modifications and Features:
- The method now employs recursion to traverse all possible paths back to the root nodes from a selected node, capturing every unique node in the hierarchies.
- A `Set` is utilized to monitor and ensure that each node is only added once to the `_selectedNodeHierarchy` list, eliminating the possibility of duplicates.
- The finalized `_selectedNodeHierarchy` list is constructed such that the root of the tree is the last item in the list, providing a more logical representation of the hierarchy.
These enhancements ensure a more accurate and efficient representation of the skill tree structure, particularly in scenarios where nodes have multiple parents, facilitating better navigation and interaction within the skill tree.
This commit introduces the `SettingsView` class, which is responsible for rendering the user interface for the settings feature of the app. This View is associated with the `SettingsViewModel` for state management and logic.
Features Represented in this View:
- Dark Mode: A switch to enable or disable Dark Mode.
- Developer Mode: A switch to enable or disable Developer Mode.
- Base URL: A text field to input and configure the Base URL.
- Continuous Mode Steps: User-friendly '+' and '-' buttons allowing users to configure the number of steps for continuous mode.
The `SettingsView` utilizes the Flutter `ListView` to display various settings options, providing an intuitive and user-friendly experience. It employs reactive state management using the `Provider` package, ensuring that any state changes in the associated ViewModel are reflected immediately in the View. Proper documentation and comments have been added for better code readability and maintenance.
This commit introduces the `SettingsViewModel` class, part of the MVVM architecture, responsible for managing the state and business logic for the settings feature of the app. This ViewModel is associated with the `SettingsView`.
Features Managed by this ViewModel:
- Dark Mode: Toggle the state of Dark Mode and notify listeners.
- Developer Mode: Toggle the state of Developer Mode and notify listeners.
- Base URL: Update the state of Base URL and notify listeners.
- Continuous Mode Steps: Increment and decrement the number of Continuous Mode Steps and notify listeners.
Each change in the state is followed by a notification to the listeners to rebuild the UI components that depend on this state, ensuring a reactive UI. To-do comments have been added where the state needs to be persisted or synchronized with a server.
* Removed `autogpt.llm.base` and `autogpt.llm.utils`
* `core` does things async, so `Agent.think()` and `Agent.execute()` are now also async
* Renamed `dump()` and `parse()` on `JSONSchema` to `to_dict()` and `from_dict()`
* Removed `MessageHistory`
* Also, some typo's and linting fixes here and there
* Make .schema model names less pedantic
* Rename LanguageModel* objects to ChatModel* or CompletionModel* where appropriate
* Add `JSONSchema` utility class in `core.utils`
* Use `JSONSchema` instead of untyped dicts for `Ability` and `CompletionModelFunction` parameter specification
* Add token counting methods to `ModelProvider` interface and implementations
This commit integrates the `LeaderboardService` into `SkillTreeViewModel` to enable benchmark report submissions to the leaderboard. A `BenchmarkRun` object is created from the evaluation response and submitted using the `submitReport` method from `LeaderboardService`.
This commit extends the `RestApiUtility` class to include support for a new leaderboard base URL. A new `ApiType` enum value `ApiType.leaderboard` has been added, and the `_getEffectiveBaseUrl` method has been updated to handle this new type. The leaderboard base URL is "https://leaderboard.vercel.app/".
This commit adds a new `LeaderboardService` class featuring a `submitReport` method. This method allows for the submission of `BenchmarkRun` objects to the leaderboard via a POST request to the `/api/reports` endpoint. The new service uses the `ApiType.leaderboard` enum value.
This commit introduces the `BenchmarkRun` class, designed to model a complete benchmark run. The class encapsulates all data and sub-models related to a benchmark, providing a centralized object to handle various aspects of a benchmark run.
The `BenchmarkRun` class includes the following sub-models:
- `RepositoryInfo`: Information about the repository and team.
- `RunDetails`: Specific details like the run identifier, command, and timings.
- `TaskInfo`: Information about the task being benchmarked.
- `Metrics`: Performance metrics for the benchmark run.
- `Config`: Configuration settings for the benchmark run.
A `reachedCutoff` field is also included to indicate whether a certain cutoff was reached during the benchmark run.
Methods for serializing and deserializing the object to and from JSON are also provided.
This commit introduces the RepositoryInfo class, designed to encapsulate details about the repository and team associated with a benchmark run.
The class includes the following fields:
- repoUrl: The URL of the repository where the benchmark code resides.
- teamName: The name of the team responsible for the benchmark.
- benchmarkGitCommitSha: The Git commit SHA for the benchmark code.
- agentGitCommitSha: The Git commit SHA for the agent code.
The class supports JSON serialization and deserialization, making it easy to use with Flutter's JSON handling mechanisms.
Added a new Dart class called `RunDetails` to represent specific details related to a benchmark run.
The class includes fields for:
- The unique run identifier (`runId`)
- The command used to initiate the benchmark (`command`)
- The time the benchmark was completed (`completionTime`)
- The time the benchmark started (`benchmarkStartTime`)
- The name of the test being run (`testName`)
Serialization and deserialization methods are also provided for JSON compatibility.
Added a new TaskInfo class to encapsulate information related to a specific benchmark task.
- The TaskInfo class holds attributes like the data file path, regression status, task categories, task details, expected answer, and description.
- Included methods for JSON serialization and deserialization.
- Added comprehensive documentation to describe the purpose, properties, and methods of the TaskInfo class.
Added a new Metrics class to represent key performance metrics of a benchmark test run.
- The Metrics class encapsulates various data points like difficulty, success rate, attempted status, success percentage, cost, and runtime.
- Included serialization and deserialization methods for converting between Metrics objects and JSON.
- Added comprehensive documentation to describe the purpose, properties, and methods of the Metrics class.
This commit introduces a new `Config` class, designed to manage and store configuration settings related to the benchmark run. The class contains two key fields:
1. `agentBenchmarkConfigPath`: The path to the agent's benchmark configuration file.
2. `host`: The address of the host where the benchmark is running.
The class includes methods for serialization and deserialization, allowing easy conversion between `Config` objects and JSON maps.
Documentation comments have also been added for better code readability and understanding.
* New benchmark data models
* Update _benchmarkBaseUrl
* Remove ReportRequestBody
* Update benchmark service methods for proxy approach
* Add eval id to SkillNodeData
* Refactor runBenchmark Method for proxy approach
This commit updates the runBenchmark method in the SkillTreeViewModel class to align with the new report generation flow. The updated method does the following:
1. Checks if a benchmark is already running to prevent overlapping runs.
2. Sets a flag to indicate that the benchmark is running and notifies the UI.
3. Reverses the selected node hierarchy for report generation.
4. Loops through each node in the reversed hierarchy to:
- Generate a unique UUID for each test run.
- Create a ReportRequestBody object.
- Call the generateSingleReport method in the BenchmarkService.
- Update the UI after each single report is generated.
5. After all single reports are generated, it calls the generateCombinedReport method in the BenchmarkService, passing in all the generated UUIDs.
6. Finally, it sets the benchmark running flag to false and notifies the UI.
This change improves the report generation flow and allows for both individual and combined reports.
This commit introduces two major updates to the BenchmarkService class:
1. Renamed the `generateReport` method to `generateSingleReport` for better clarity and specificity.
2. Added a new method called `generateCombinedReport` that takes a list of test run IDs and generates a combined report by posting to the `/reports/query` endpoint.
These changes aim to improve the modularity and readability of the code, while also extending its functionality to handle combined reports.
This commit introduces substantial improvements to the TaskView class to accommodate both tasks and test suites in a unified view. It also integrates the TestSuiteDetailView to display test suite details when a test suite is selected.
Key Enhancements:
1. Modified the `initState` method to call `fetchAndCombineData()` from TaskViewModel, thereby populating the combined data source.
2. Replaced the ListView that was rendering tasks with a ListView that can render both tasks and test suites.
3. Introduced conditional rendering for TestSuiteDetailView when a test suite is selected.
4. Updated onTap actions to select and deselect tasks and test suites appropriately.
5. Moved to using a Stack layout to allow overlay of TestSuiteDetailView on top of the existing layout.
This refactor enhances the TaskView's capabilities to manage and display both tasks and test suites, offering a more integrated user experience.
This commit significantly expands the functionalities of TaskViewModel to manage both tasks and test suites in a unified manner. The view model now serves as the primary business logic class that interacts with the UI for task and test suite management.
Key Enhancements:
- Introduced `_testSuites` list to store TestSuite objects.
- Added `combinedDataSource` to hold both tasks and test suites.
- Introduced `selectTestSuite` and `deselectTestSuite` methods for TestSuite selection management.
- Added methods for TestSuite CRUD operations (`addTestSuite`, `fetchTestSuites`, `_saveTestSuitesToPrefs`).
- Created `fetchAndCombineData` method to fetch and combine tasks and test suites into a single list, `combinedDataSource`.
This update provides a more robust and unified approach for managing tasks and test suites, thereby improving the application's modularity and scalability.
This commit introduces a new StatefulWidget, TestSuiteDetailView, to offer a dedicated view for managing and interacting with individual Test Suites.
Key Features:
- Created a TestSuiteDetailView class that takes a TestSuite object and a TaskViewModel as parameters.
- Added an AppBar with a back button for easy navigation.
- Utilized ListView.builder to display a list of tasks that belong to the selected Test Suite.
- Integrated with existing TaskViewModel to select and delete tasks within the Test Suite.
- Included a Provider for the ChatViewModel to update the current task ID when a task is selected.
This new view enhances the user experience by providing a focused interface for managing tasks within individual Test Suites. This facilitates better organization and navigation for the user.
This commit adds a new StatelessWidget, TestSuiteListTile, designed to display individual TestSuite items in a list.
Key Features:
- Created a TestSuiteListTile class that takes a TestSuite object and a VoidCallback for the onTap event as parameters.
- Utilized Material Design with custom styling to ensure the tile fits well within the application's UI.
- The tile displays the timestamp of the TestSuite, which serves as its title.
- Included a play arrow icon to indicate that the tile is actionable.
- Utilized MediaQuery to adapt the tile width based on the screen size, capped at a maximum width of 260.
By adding this widget, we improve the UX by providing a consistent and intuitive way to interact with TestSuite objects in the UI.
This commit introduces a new class, TestSuite, designed to encapsulate a collection of Task objects under a common timestamp. This will help in grouping tasks that belong to a particular test suite.
Key Features:
- Add a TestSuite class with fields for `timestamp` and a list of `tests` (Task objects).
- Implement `toJson` method for serializing TestSuite objects to JSON-compatible format.
- Implement `fromJson` factory method for deserializing JSON data back into a TestSuite object.
By providing serialization and deserialization support directly in the model, we facilitate easier storage and data exchange for test suites.
This commit adds serialization support to the Task model by including a `toJson` method. This will allow easy conversion of Task objects to a JSON-compatible format, facilitating storage or network transmission.
* Typing fixes & improvements
* Improved console output formatting
* Added support for all OpenAI GPT-3.5-turbo and GPT-4 model versions
* Added token counting functions to ModelProviders
Added a state variable isBenchmarkRunning in SkillTreeViewModel to track the status of benchmark execution. This state variable is used to conditionally disable specific UI components:
- The "Initiate test suite" button in TaskQueueView is disabled during the benchmark.
- All IconButtons in SideBarView are disabled during the benchmark.
- Node selection in SkillTreeView is disabled during the benchmark.
This ensures that the user cannot interact with these components while a benchmark test is running, thereby improving UX and preventing potential issues.
This commit updates the `TaskQueueView` to pass real data from the `selectedNodeHierarchy` to the `callGenerateReport` method in `SkillTreeViewModel`. An array of test names is constructed from the reversed node hierarchy, and these names are used as the `tests` field in the `ReportRequestBody`.
Note: The `category` field is now an empty string as per the new requirement, and `mock` continues to be set to true.
This commit integrates the `callGenerateReport` method from `SkillTreeViewModel` into the `TaskQueueView`. Now, when the user clicks the green checkmark button, the `callGenerateReport` method is triggered with hardcoded values for testing purposes.
Note: The implementation is still temporary and will be updated for dynamic behavior in the future.
This commit adds a new boolean field, "mock", to the `ReportRequestBody` class. This additional field is in line with the new requirements to specify whether the report is a mock or not.
The `toJson()` method is also updated to include this new field during serialization.
This commit integrates Firebase Authentication into the application and refactors the `main.dart` file to streamline the user authentication flow. The application will now automatically switch between the main layout and the authentication UI based on the user's sign-in status.
- Added Firebase initialization to the `main()` function for Firebase Authentication.
- Replaced the home page in `MyApp` with a `StreamBuilder` that listens for Firebase auth state changes.
- Based on the auth state, the home page will either show `MainLayout` (if the user is signed in) or `FirebaseAuthView` (if the user is not signed in).
- Added necessary imports for the Firebase and authentication services.
This commit adds the `FirebaseAuthView` class, a Flutter widget that serves as the UI for user authentication using Google and GitHub. The class uses the `AuthService` to handle the actual sign-in logic.
Features:
- Added an OutlinedButton for Google Sign-In, styled with Google's colors and logo.
- Added an OutlinedButton for GitHub Sign-In, styled with GitHub's colors and logo.
- Integrated the `AuthService` methods for Google and GitHub sign-in.
This commit introduces the AuthService class, which encapsulates the logic for signing in with Google and GitHub using Firebase Authentication. The class provides methods for initiating the OAuth flows for both providers and for signing out the user.
- Implemented `signInWithGoogle()` to handle Google Sign-In.
- Implemented `signInWithGitHub()` to handle GitHub Sign-In via popup.
- Added `signOut()` method for logging out the user.
- Added `getCurrentUser()` method to fetch the currently authenticated user.
This commit integrates the `BenchmarkService` into the main application setup through the `MultiProvider` in `main.dart`. The changes include:
1. Adding `BenchmarkService` to the list of service providers, allowing it to be accessible throughout the application via dependency injection.
2. Using `ProxyProvider` to ensure `BenchmarkService` gets the `RestApiUtility` instance as a dependency.
3. Modifying the `MyApp` class to fetch the `BenchmarkService` from the provider, making it ready for use in the application's lifecycle.
This addition allows `BenchmarkService` to be centrally managed and readily available for any part of the application that requires benchmark-related functionalities.
This commit enhances the `RestApiUtility` class to support multiple base URLs by incorporating an `ApiType` enum parameter in its methods. The changes include:
1. `_agentBaseUrl`: The base URL for the agent-related API calls.
2. `_benchmarkBaseUrl`: A hard-coded base URL for benchmark-related API calls.
3. `_getEffectiveBaseUrl`: A new private method that determines the effective base URL based on the given `ApiType`.
All public methods (`get`, `post`, `getBinary`) have been updated to include an optional `ApiType` parameter, which defaults to `ApiType.agent`. Based on this parameter, `_getEffectiveBaseUrl` is called to decide the base URL for the HTTP request.
This change allows for flexible API calls without the need to instantiate multiple `RestApiUtility` objects for different services.
This commit extends the `SkillTreeViewModel` to include `BenchmarkService` as a dependency. This integration allows for leveraging benchmark-related API calls within the skill tree logic.
Two new methods have been added to `SkillTreeViewModel`:
1. `callGenerateReport`: This method attempts to call the `generateReport` function from the `BenchmarkService`. Currently, it only prints the API response and is incomplete in terms of full functionality.
2. `callPollUpdates`: Similar to `callGenerateReport`, this method aims to call `pollUpdates` from `BenchmarkService` and prints the API response. This is also incomplete and will require further development.
Both methods are preliminary and will require additional features to become fully functional.
This commit introduces the `BenchmarkService` class, which encapsulates API calls related to benchmarking operations. The class includes two methods:
1. `generateReport`: Takes a `ReportRequestBody` object as input and performs a POST request to the `/reports` URL, serializing the object to JSON format.
2. `pollUpdates`: Accepts a UNIX UTC timestamp as an argument and performs a GET request to the `/updates?last_update_time=<timestamp>` URL.
Both methods use the `RestApiUtility` for making HTTP requests and are designed to work with different base URLs, controlled by the `ApiType` enum.
This commit adds a new enum, `ApiType`, to allow dynamic selection between different base URLs for API calls. The enum has two values: `agent` and `benchmark`, corresponding to different services.
The `ApiType` enum is designed to be passed as a parameter to the `RestApiUtility` methods, enabling the utility to decide which base URL to use for HTTP requests.
This commit introduces a new Dart class, `ReportRequestBody`, which represents the request body for generating reports in the `BenchmarkService`. The class includes a `toJson` method for easy serialization to JSON format.
- `category`: Specifies the category of the report (e.g., "coding").
- `tests`: A list of tests to be included in the report.
This commit substantially upgrades the SkillTreeViewModel by incorporating asynchronous initialization from a JSON asset. Now, both nodes and edges of the skill tree are dynamically generated based on the JSON data. This not only enhances the modularity of the code but also simplifies the process of updating or modifying the skill tree.
Other improvements include:
- Changed node IDs from integers to strings for better flexibility.
- Added a function to get a node by its ID, improving code reusability.
- Introduced error handling for potential issues during JSON parsing or node retrieval.
- Updated the sibling, level, and subtree separation configurations for the graph view layout.
These changes make the skill tree more dynamic and maintainable, setting the stage for future extensions.
This commit refactors the SkillTreeView class to include asynchronous initialization through FutureBuilder. The new version also replaces the integer-based node IDs with string-based IDs, aligning better with the SkillTreeNode model. The code now clears previous graph nodes and edges before adding new ones, preventing duplication. Additionally, the TreeNodeView component is now populated dynamically with data from the SkillTreeNode model, making the tree view more robust and integrated.
This commit updates the TreeNodeView class from a stateless widget to a stateful widget to handle hover interactions. The new version also replaces the old simple text-based representation with a more interactive and visually appealing design that includes icons and hover effects. The SkillTreeNode model is now used to populate the node information, making the TreeNodeView more dynamic and integrated with the rest of the application.
This commit extends the SkillTreeNode class to incorporate new attributes such as 'data', 'label', and 'shape', making the model more comprehensive. The JSON deserialization is also updated to handle optional or missing fields by providing default values, improving the robustness of the model.
This commit updates the SkillNodeData class to handle optional or missing JSON fields more robustly. Now, the model provides default values for each field, ensuring that the object can be instantiated successfully even if some JSON fields are missing or set to null.
This commit updates the Info class to provide default values for optional or missing fields in the JSON payload. This ensures that the model can be successfully instantiated even when some JSON fields are absent or set to null.
This commit modifies the Ground class to make it more robust against optional or missing fields in the incoming JSON data. Default values have been added to ensure that the model can be instantiated even if some JSON fields are missing or set to null.
This commit adds the tree_structure.json file to the assets directory, which contains the initial skill tree structure. This JSON file will serve as the data source for rendering the skill tree nodes and edges in the application.
* Add TestQueueView to Main Layout
This commit integrates the TestQueueView into the main layout. The layout now conditionally displays the TestQueueView based on whether a node in the SkillTree is selected.
- TestQueueView appears when a SkillTree node is selected.
- Main layout adjusts to accommodate TestQueueView alongside SkillTreeView and ChatView.
- Implemented responsive layout logic to manage the widths of the different views based on the screen width and the state of the SkillTree.
* Extend SkillTreeViewModel to Track Selected Node Hierarchy
This commit enhances the SkillTreeViewModel to maintain a list of nodes that form a hierarchy from the currently selected node to the root. This allows for more interactive and informative views that can leverage this hierarchical data.
- Added a new property `selectedNodeHierarchy` to keep track of the node hierarchy.
- Modified the `toggleNodeSelection` method to populate or clear `selectedNodeHierarchy` based on node selection.
- Introduced a new method `populateSelectedNodeHierarchy` to build the hierarchy from the selected node to the root.
* Extract skill tree view model reset state to method
* Implement UI enhancements for TaskQueueView
This commit introduces several UI improvements to the TaskQueueView:
- Tiles are padded 20 units from both the leading and trailing edges.
- Tiles now have a white background.
- Added a thin black border to the tiles.
- Incorporated a slight corner radius for the tiles.
- Centered the title and subtitle horizontally within the tiles.
- Added a checkmark button with a tooltip at the bottom-right corner for running a suite of tests.
These changes aim to improve the user experience and visual appeal of the TaskQueueView.
* Make MainLayout a consumer of SkillTreeViewModel
This commit replaces the placeholder implementation of the SkillTreeView class with a complete, functional version.
Features:
- Initializes the skill tree from the SkillTreeViewModel during `initState`.
- Dynamically creates Node and Edge objects for GraphView based on ViewModel data.
- Utilizes the TreeNodeView to render individual nodes.
- Integrates node selection functionality from the ViewModel.
- Adds InteractiveViewer for zoom and pan capabilities.
The new SkillTreeView is designed to work closely with SkillTreeViewModel to manage and display the skill tree.
This commit adds the TreeNodeView class, a StatelessWidget responsible for rendering individual nodes in the skill tree.
Features:
- Displays the node ID in the view.
- Uses the Provider package to interact with the SkillTreeViewModel.
- Includes an onTap method to toggle node selection state.
- Updates the UI to reflect the selected state by changing the background color.
The TreeNodeView is designed to work in conjunction with SkillTreeViewModel to manage node selection states.
The SkillTreeViewModel class serves as the view model for the skill tree and extends Flutter's ChangeNotifier for state management.
Features include:
- Storing and managing the list of SkillTreeNodes and SkillTreeEdges.
- Managing the state of the selected node.
- Initializing the skill tree with predefined nodes and edges.
- Methods for toggling node selection, allowing for only a single node to be selected at any given time.
The view model utilizes the GraphView package for visualization and layout.
The SkillTreeEdge model represents the relationship between different skill nodes.
It includes:
- Edge ID
- Source node ID
- Destination node ID
- Arrows property to indicate directionality
The SkillNodeData model aggregates various data related to a skill node.
It includes:
- Node name
- Node category
- Associated task
- Dependencies
- Cutoff value
- Ground object for evaluation details
- Info object for metadata
The Info data model holds metadata about a skill node.
It includes:
- The difficulty level of the skill node
- A description of the skill node
- A list of potential side effects related to the skill node
The Ground data model stores evaluation information for each skill node.
It includes:
- The answer to be evaluated
- A list of terms that should be contained in the answer
- A list of terms that should not be contained in the answer
- A list of associated files
- A map for additional evaluation criteria
Added the downloadArtifact method to the ChatService class, enabling the download of artifacts in the Flutter web application. The function uses the dart:html package to trigger a browser-based file download, allowing users to save artifacts locally. This implementation complements the existing REST API and enhances the user experience.
Implemented auto-scrolling in the chat message list to ensure that the view scrolls down to the most recent message when a new chat is added. This behavior only triggers if the user is already at the bottom of the list, providing a seamless user experience.
- Added a new boolean state `isContinuousMode` to the `ChatInputField` widget to handle the continuous mode feature.
- Introduced a new callback function `onContinuousModePressed` to manage the state of the continuous mode from an external source.
- Conditionally rendered the send button based on the `isContinuousMode` state.
- Enhanced the UI by adding a button to toggle between continuous mode and single message mode, which triggers the `onContinuousModePressed` callback.
Added a new state variable `_isContinuousMode` to the ChatViewModel to track whether the chat is in continuous mode or not. This state is toggled via a setter and triggers UI updates through `notifyListeners()`.
Enhanced the `sendChatMessage` method to automatically send a null message if continuous mode is active, triggering the next step in the chat.
Updated the StepRequestBody class to allow both 'input' and 'additionalInput' to be optional. Added logic in toJson() method to return an empty JSON object if both fields are null.
This commit wraps the TaskView and ChatView in a SafeArea widget to ensure that they are not hidden behind the CupertinoTabView. This addresses the issue where parts of these views were obscured, particularly when using the app on smaller screens.
- Wrapped TaskView in SafeArea
- Wrapped ChatView in SafeArea
This change improves the user experience by ensuring that all content is visible and accessible.
This commit integrates the actual JSON response received from the API into the AgentMessageTile. Now, each AgentMessageTile will display the associated JSON response when expanded.
- Converted Map<String, dynamic> JSON response to a string using jsonEncode.
- Passed the JSON-formatted string to JsonCodeSnippetView.
- Updated AgentMessageTile to include this change.
This change enhances the debugging and transparency features of the chat interface.
Update TaskListTile to truncate task titles that overflow.
- Modify the Text widget to limit it to a single line.
- Add TextOverflow.ellipsis to show an ellipsis when the text overflows.
Ensure that only one TaskListTile can be selected at a time.
- Refactor TaskListTile to be a StatelessWidget.
- Remove internal state `_isSelected` from TaskListTile.
- Add a `selected` boolean prop to TaskListTile to control its selection state from the parent.
- Update the parent widget to manage the selection state and pass it down to TaskListTile.
- Extended TaskService to manage a list of deleted tasks using shared_preferences.
- Modified TaskViewModel to filter out tasks that have been marked as deleted locally.
- Loaded the list of deleted tasks during app initialization in main.dart.
- Replaced direct service initialization with Provider and ProxyProvider in main.dart.
- Introduced a ChangeNotifierProxyProvider for ApiSettingsViewModel to include a reference to RestApiUtility.
- Refactored MyApp class to fetch services from providers instead of direct instantiation.
This commit enhances the dependency injection pattern to support dynamic updates to the API base URL. The use of ProxyProvider allows for more flexible and efficient management of dependencies, particularly between RestApiUtility and other services.
- Added ApiBaseUrlField widget to the TaskView.
- Included a TextEditingController to manage the API base URL value.
- Initialized the text field with the current base URL value from ApiSettingsViewModel.
- Modified the layout to place the API base URL field and associated buttons below the task list.
The commit introduces a user interface enhancement that allows the user to update the API base URL directly from the TaskView. This ensures better configurability and user experience.
- Added a reference to RestApiUtility within ApiSettingsViewModel.
- Modified _loadBaseURL and updateBaseURL methods to update the base URL in RestApiUtility whenever a change is made.
- This ensures that changes to the base URL in the settings are propagated to the utility responsible for making API calls.
This integration allows the application to dynamically update the base URL for API calls through the user interface, enhancing flexibility and configurability.
- Extracted the API Base URL field and associated buttons into a new ApiBaseUrlField widget.
- Utilized Consumer to listen for changes in ApiSettingsViewModel.
- Maintained the look and feel consistent with the application's existing UI elements.
This refactor enhances code modularity and readability by isolating the API settings UI in its own widget.
Updated main.dart to provide ApiSettingsViewModel at the top-level using MultiProvider. This ensures that the ViewModel is accessible throughout the app, allowing for dynamic updates to the API's base URL.
Modified RestApiUtility to include a method for updating the base URL dynamically. This allows the application to adapt to changes in the API's base URL without requiring a restart.
Created a new ViewModel called ApiSettingsViewModel that is responsible for getting and setting the API's base URL. Utilized the shared_preferences package for persistent storage of the base URL.
This commit updates the ViewModel classes for both Chat and Task to accommodate the new structured responses received from the API. These changes are essential for the correct functioning of the application as they deal with the new TaskResponse and Step objects.
Updates in ChatViewModel:
- Modified `fetchChatsForTask` to handle structured step data
- Updated how steps are retrieved and processed
Updates in TaskViewModel:
- Updated `fetchTasks` to use the new TaskResponse object
- Refactored task fetching and selection logic
These updates ensure that the ViewModel classes are aligned with the new structured API responses, improving data handling and UI updates.
This commit updates the ChatService and TaskService classes to use the api.get method instead of the previous api.getList. This change allows us to handle structured API responses more effectively, particularly those containing pagination information and detailed task and step data.
- Update ChatService methods to use api.get
- Update TaskService methods to use api.get
- Handle structured TaskResponse in TaskService.listAllTasks
This commit introduces a new class called TaskResponse, which holds both the tasks and pagination information returned from the API. The class includes a factory constructor to create an instance from JSON data, ensuring that the API response is neatly packaged into an easily manageable object. This enhances code readability and maintainability.
- Create a TaskResponse class with tasks and pagination fields
- Add a factory constructor for JSON to TaskResponse conversion
This commit updates the Task model to include optional fields for
'additionalInput' and 'artifacts'. The 'fromMap' factory method is also
adapted to populate these fields if they exist in the JSON response.
This change aligns the Task model with the expected server responses,
making it more flexible and robust.
Added a new Pagination class to model the pagination data that comes with API responses. This will help in handling paginated data more effectively and transparently.
The Pagination class includes fields for total items, total pages, current page, and page size. It also includes a factory constructor for creating an instance from a JSON object.
This commit refactors the main.dart file to include service initialization and dependency injection:
- RestApiUtility Initialization: Initialize the RestApiUtility with a mock API endpoint.
- Service Initialization: Initialize ChatService and TaskService with the created RestApiUtility.
- Dependency Injection: Pass the initialized services to MyApp constructor.
- Provider Update: Replace the ChangeNotifierProvider creation in MultiProvider to use the new ChatViewModel and TaskViewModel initialized with the respective services.
This setup allows for better separation of concerns and easier testing, as the services are now decoupled from the view models.
This commit adds functionality to handle user interactions in the TaskView class by implementing the onPressed, onTap, and onDelete methods:
- onPressed: Triggered when the "New Task" button is pressed. It clears the current task ID and chat history in the ChatViewModel.
- onTap: Triggered when a task list tile is tapped. It selects the task in TaskViewModel and updates the current task ID in ChatViewModel.
- onDelete: Triggered when the delete button on a task list tile is pressed. It deletes the task from TaskViewModel and clears the current task ID and chat history in ChatViewModel if the deleted task was the current task.
These implementations provide a seamless user experience for managing tasks and associated chats.
This commit enhances the ChatView class by implementing the onSendPressed functionality, which is triggered when the user sends a message through the ChatInputField:
- When onSendPressed is triggered, it checks if a task ID is currently selected (currentTaskId in ChatViewModel).
- If a task ID is selected, the message is sent as a chat message for that task using sendChatMessage from ChatViewModel.
- If no task ID is selected, a new task is created using createTask from TaskViewModel, and then the message is sent for that new task.
This change provides a complete workflow for sending chat messages, either within an existing task or by creating a new task.
This commit brings a key update to the ChatInputField widget, making it more flexible and decoupled:
- The onSendPressed callback now takes a string parameter. This string represents the message that the user wishes to send.
- The onPressed of the send button (IconButton) is now implemented within the ChatInputField widget. It checks if the TextField has any text before calling onSendPressed.
- Added a TextEditingController to manage the TextField's content.
This commit includes a significant overhaul of the TaskViewModel to use the newly created TaskService and integrate it with the task API. Specifically:
- Removed dependency on mock data for tasks.
- Added real API calls through the TaskService for task operations like creating and fetching tasks.
- Updated createTask to return the ID of the newly created task.
- Updated fetchTasks method to fetch tasks from the API and update the local list.
- Updated selectTask to handle selection based on string IDs.
These changes make the TaskViewModel ready for real-world usage and remove dependencies on mock data.
This commit refactors the ChatViewModel to use the newly created ChatService and Step model for chat-related functionalities. The changes include:
- Replaced mock data source with real API calls via ChatService.
- Introduced _currentTaskId to keep track of the current task ID.
- Added fetchChatsForTask method to fetch steps related to the current task and populate the chat list.
- Implemented sendChatMessage to execute a step and add both user and agent messages to the chat list.
By making these changes, the ChatViewModel is now fully integrated with the backend services and models, thus enabling a more realistic and dynamic chat experience.
This commit adds a new TaskService class to handle all task-related operations, including task creation, listing, and artifacts management.
- Implemented methods for creating a new task (createTask).
- Added functionality to retrieve details for a specific task (getTaskDetails).
- Enabled listing all tasks with optional pagination (listAllTasks).
- Enabled listing all artifacts for a specific task with optional pagination (listTaskArtifacts).
By encapsulating these operations within the TaskService class, this commit provides a clean and centralized way to interact with the backend for task functionalities, making the application more maintainable and easier to extend.
This commit adds a new ChatService class to handle all chat-related operations, including steps and artifacts.
- Implemented methods for executing a step within a task (executeStep).
- Added functionality to retrieve details for a specific step (getStepDetails).
- Enabled listing all steps for a specific task with optional pagination (listTaskSteps).
- Laid groundwork for artifact uploading (uploadArtifact) and downloading (downloadArtifact), though these are not implemented yet.
By encapsulating these operations within the ChatService class, this commit provides a clean and centralized way to interact with the backend for chat functionalities, making the application more maintainable and easier to extend.
This commit introduces the Step class to the codebase, designed to model the steps related to tasks.
- Implemented Step class with both required and optional fields.
- Provided a fromMap factory method for easy deserialization from API responses.
- Ensured that optional fields are handled gracefully, providing default values where necessary.
The addition of the Step class lays the foundation for more complex interactions with tasks, including the ability to handle steps with varying levels of information. This makes the application more flexible and robust when interfacing with the backend.
This commit introduces a new utility class, RestApiUtility, designed to encapsulate all the HTTP request operations.
- Created RestApiUtility class with a constructor that accepts a base URL.
- Added get method to perform GET requests and return data as a Map.
- Added getList method to perform GET requests and return data as a List.
- Added post method to perform POST requests with payload and return data as a Map.
The class uses the http package for making network calls and dart:convert for JSON serialization and deserialization. This centralized approach makes it easier to manage API calls and handle errors across the application.
This commit updates the Task model to use string-based identifiers (id) instead of integers. The change aligns the model with the backend service, which uses string-based UUIDs for task identification.
This commit updates the Chat model to use string-based identifiers (id and taskId) instead of integers. This change aligns the model with the backend service, which uses string-based UUIDs for task and chat identification.
This commit adds the TaskRequestBody class, which is designed to encapsulate the request body when creating a new task. The class includes a toJson method for easy serialization to JSON format.
Additionally, unit tests have been written to ensure that the TaskRequestBody object is created with the correct values and that it serializes to the expected JSON structure.
- Added TaskRequestBody class with input and optional additionalInput fields.
- Implemented toJson method for converting an instance of the class to JSON.
- Added unit tests to verify both object creation and JSON serialization.
These changes provide a standardized way to manage the request body when creating new tasks, improving the overall code quality and maintainability.
This commit introduces the StepRequestBody class, designed to encapsulate the request body for sending a chat message in the form of a step. The class includes a toJson method for easy serialization to JSON format.
Additionally, unit tests have been added to ensure that the StepRequestBody object is created with the correct values and that it serializes to the expected JSON format.
- Added StepRequestBody class with input and optional additionalInput fields.
- Implemented toJson method for converting an instance of the class to JSON.
- Added unit tests to verify both object creation and JSON serialization.
These changes provide a robust way to manage the request body for step-based chat messages.
This commit introduces the ChatView widget, a central component of the application that manages the chat interface. It's responsible for displaying both agent and user messages and includes the following features:
- Fetching chats for a specific task upon initialization.
- A reverse ListView to display chats with the most recent messages at the bottom.
- Dynamic rendering of UserMessageTile and AgentMessageTile widgets based on message type.
- Integration with the ChatInputField for inputting user messages.
- Placeholder logic for handling send action, to be implemented later.
This implementation lays the groundwork for a fully functional chat interface within the application, allowing for a seamless interaction between users and agents.
This commit introduces the AgentMessageTile widget, a core component of the chat interface. The widget is designed to display agent messages, including a collapsible section for displaying a pretty-printed JSON code snippet.
The following features have been implemented:
- Rendering of agent title, message text, and expand/collapse button.
- Expandable section for displaying a JSON code snippet, complete with copy functionality.
- A minimum height constraint to ensure consistent appearance.
- Widget tests to validate rendering and interaction behavior.
These enhancements contribute to the overall chat functionality, providing a clear and interactive display of agent messages.
This commit introduces the UserMessageTile widget, designed to display user messages in the chat interface. The widget includes the following features:
- Proper alignment based on available screen width
- A predefined minimum height with flexible expansion for longer messages
- Styling including a white background, thin black border, and small corner radius
Alongside the widget, this commit also includes comprehensive widget tests to ensure the correct rendering and functionality of the UserMessageTile. The tests cover:
- Rendering without errors
- Displaying the correct user message
- Showing the "User" title as expected
These implementations improve the structure and readability of the user messages within the chat view, ensuring a consistent and user-friendly experience.
This commit introduces the JsonCodeSnippetView, a widget designed to display JSON data in a pretty-printed format. Users can view the JSON content with proper indentation and formatting, enhancing readability.
Features:
- The JSON data is displayed using the HighlightView with GitHub-themed syntax highlighting.
- A copy button (IconButton) is provided to allow users to easily copy the pretty-printed JSON to the clipboard.
- Padding and layout adjustments ensure that the view fits seamlessly within the designated space, with scrollable content if the JSON exceeds the available space.
This widget enhances the user experience when interacting with JSON data, providing a clean and efficient way to view and copy content.
This commit introduces the ChatInputField widget, a custom text input field designed for use within the ChatView. The ChatInputField widget handles varying screen sizes and gracefully resizes itself according to the available width. It starts with a height of 50 and can expand up to 400 as the user types more lines of text.
In addition to the implementation, this commit also includes widget tests to ensure the ChatInputField behaves as expected.
- Add ChatInputField widget with dynamic resizing
- Include IconButton for sending messages
- Add widget tests for ChatInputField
- Handle edge cases and overflows
In this commit, the app underwent significant UI improvements by leveraging new, more modular widgets (NewTaskButton and TaskListTile). This ensures better code maintainability and a cleaner architecture.
Key changes include:
Integrated ChangeNotifierProvider in main.dart to facilitate the creation and broadcasting of TaskViewModel.
Refactored TaskView to utilize the newly created NewTaskButton and TaskListTile widgets.
Updated MainLayout to reflect the changes and provide a more cohesive user experience.
This commit introduces the TaskListTile, a custom widget designed to display individual tasks in the TaskView. The tile offers a user-friendly interface with interactive features, such as selection and deletion.
Key Features:
- Responsive design that adapts its width based on the TaskView's constraints.
- Interactive tile that changes its background color upon selection.
- A delete icon that appears only when the tile is selected.
- Comprehensive widget tests to ensure the TaskListTile behaves as expected.
By splitting this into its own widget, the codebase remains modular, making it easier to maintain and update in the future.
This commit introduces the NewTaskButton widget, designed to allow users to create new tasks. The button follows specific design guidelines, including dimensions, colors, and layout.
Key Features:
Button with a set height and adaptive width.
Icon and text layout within the button.
Styling for background, border, and corner radius.
Associated tests to ensure the button's functionality and appearance.
* Rename PromptConfig to AIDirectives
* Make PromptGenerator primarily responsible for generating prompt instead of AIConfig
* Refactor PromptGenerator
* Add `available` attribute to `Command` class, to determine availability based on `Agent` state
This commit introduces the ChatViewModel, which manages the business logic for chat interactions associated with tasks. The ViewModel communicates with a mock data source, offering functionalities like fetching chats for a specific task and sending chat messages.
In addition to the implementation, comprehensive tests for ChatViewModel have been provided to ensure its behavior is consistent with our design goals and expectations.
Key Features:
Chat management in ChatViewModel.
Tests covering all major functionalities of ChatViewModel.
Mock data source updates to emulate chat data interactions.
This commit introduces the TaskViewModel, which manages the business logic for tasks. The ViewModel interacts with a mock data source, providing functionalities like fetching tasks, selecting a task, creating, and deleting tasks.
Additionally, comprehensive tests for TaskViewModel have been added to ensure its behavior aligns with expectations. The mock data source has also been updated to support the new functionalities.
Key Features:
- Task management in TaskViewModel.
- Tests for each major functionality in TaskViewModel.
- Mock data source to simulate data interactions.
* Add categories to command registry
* Fix tests
* Clean up prompt generation
* Rename Performance Evaluations to Best Practices
* Move specification of response format from system prompt to Agent.construct_base_prompt
* Clean up PromptGenerator class
* Add debug logging to AIConfig autogeneration
* Clarify prompting and add support for multiple thought processes to Agent
* WIP: PlanningAgent
* Disable message history by default on BaseAgent
* Add CommandOutput and ThoughtProcessOutput type aliases
* Fix interrupts in main.py
* Use custom exceptions and clean up exception/error handling
* Remove duplicate agent_history.py
* Update PlanningAgent from upstream
* WIP: Support for dynamic in-prompt context
* WIP: response formats for PlanningAgent three-stage cycle
* Remove browsing overlay & separate browsing from extraction code
* Fix human feedback
* Fix tests
* Include history in Agent prompt generation
* Code improvements in agent.py
* Add ask_user command and revise system prompt
* Bulleting update & version bump
* Bulletin.md updates
* Format bulletin
* Added info about new documentation theme.
---------
Co-authored-by: lc0rp <2609411+lc0rp@users.noreply.github.com>
* Added SUMMARIZATION_TRIGGER_LENGTH
browse_website won't summarize content that's shorter
than SUMMARIZATION_TRIGGER_LENGTH.
It defaults to 250 characters, which is approximately 50 tokens.
* Refactor BrowserOptions
* Use tokens instead of length
to trigger summarization
* Bugfix
* fix: Always return links even if not summarizing
feat: Increase the number of links returned from 5 to 20
---------
Co-authored-by: lc0rp <2609411+lc0rp@users.noreply.github.com>
Co-authored-by: James Collins <collijk@uw.edu>
* Add information on how to improve Auto-GPT with agbenchmark
* Update introduction.md
* Update docs/challenges/introduction.md
Co-authored-by: Reinier van der Leer <reinier.vanderleer@agpt.co>
* Update introduction.md
---------
Co-authored-by: James Collins <collijk@uw.edu>
Co-authored-by: Reinier van der Leer <reinier.vanderleer@agpt.co>
* fix omitted "()" in __str__(self) in core/ability/base.py
* put back async keyword in the base class
* Remove extra () in OpenAISettings class in
autogpt/core/resourece/model_providers/openai.py
---------
Co-authored-by: James Collins <collijk@uw.edu>
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
* Clean up prompt generation
* Rename Performance Evaluations to Best Practices
* Move specification of response format from system prompt to Agent.construct_base_prompt
* Clean up PromptGenerator class
* Add debug logging to AIConfig autogeneration
* Clarify prompting and add support for multiple thought processes to Agent
* Use modern material theme for docs
* Further file path fixes, and doc updates to specify when relative paths are expected
* fix: lint
* Remove unwated changes
* Remove comments
---------
Co-authored-by: lc0rp <2609411+lc0rp@users.noreply.github.com>
Co-authored-by: Reinier van der Leer <reinier.vanderleer@agpt.co>
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* Fix and clean up path processing in logs module
* Fix path processing throughout the project
* Fix plugins test
* Fix borky pytest vs mkdir(exist_ok=True)
* Update docs and gitignore for new workspace location
* Fix borky pytest vol.2
* ok james
* Move rename module `agent` -> `agents`
* WIP: abstract agent structure into base class and port Agent
* Move command arg path sanitization to decorator
* Add fallback token limit in llm.utils.create_chat_completion
* Rebase `MessageHistory` class on `ChatSequence` class
* Fix linting
* Consolidate logging modules
* Wham Bam Boom
* Fix tests & linting complaints
* Update Agent class docstring
* Fix Agent import in autogpt.llm.providers.openai
* Fix agent kwarg in test_execute_code.py
* Fix benchmarks.py
* Clean up lingering Agent(ai_name=...) initializations
* Fix agent kwarg
* Make sanitize_path_arg decorator more robust
* Fix linting
* Fix command enabling lambda's
* Use relative paths in file ops logger
* Fix test_execute_python_file_not_found
* Fix Config model validation breaking on .plugins
* Define validator for Config.plugins
* Fix Config model issues
* Fix agent iteration budget in testing
* Fix declaration of context_while_think
* Fix Agent.parse_and_process_response signature
* Fix Agent cycle_budget usages
* Fix budget checking in BaseAgent.__next__
* Fix cycle budget initialization
* Fix function calling in BaseAgent.think()
* Include functions in token length calculation
* Fix Config errors
* Add debug thing to patched_api_requestor to investigate HTTP 400 errors
* If this works I'm gonna be sad
* Fix BaseAgent cycle budget logic and document attributes
* Document attributes on `Agent`
* Fix import issues between Agent and MessageHistory
* Improve typing
* Extract application code from the agent (#4982)
* Extract application code from the agent
* Wrap interaction loop in a function and call in benchmarks
* Forgot the important function call
* Add docstrings and inline comments to run loop
* Update typing and docstrings in agent
* Docstring formatting
* Separate prompt construction from on_before_think
* Use `self.default_cycle_instruction` in `Agent.think()`
* Fix formatting
* hot fix the SIGINT handler (#4997)
The signal handler in the autogpt/main.py doesn't work properly because
of the clean_input(...) func. This commit remedies this issue. The issue
is mentioned in
3966cdfd69 (r1264278776)
* Update the sigint handler to be smart enough to actually work (#4999)
* Update the sigint handler to be smart enough to actually work
* Update autogpt/main.py
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* Can still use context manager
* Merge in upstream
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* Fix CI
* Fix initial prompt construction
* off by one error
* allow exit/EXIT to shut down app
* Remove dead code
---------
Co-authored-by: collijk <collijk@uw.edu>
Co-authored-by: Cyrus <39694513+cyrus-hawk@users.noreply.github.com>
* fix for #4975
* Add TODO based on code comment.
* Use builtin `Path.as_posix()`
* Remove TODO
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* add feature custom text embedding in plugin
* black code format
* _get_embedding_with_plugin()
* Fix docstring & type hint
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
Changed Colorama.Fore.ORANGE to YELLOW in config.py, As Colorama does not support an ORANGE color. This fixes a fatal error in run.sh when trying to set the API key through the input() method.
Co-authored-by: James Collins <collijk@uw.edu>
* Add initial share logs page
* Fix title sizes
* Update share_logs.md
Added some text for reasons to share logs
* Add section on how to share logs using e2b
* Fix path to images with sizes
* Fix paths to images in docs
* Fix formatting
* Fix formatting
* Fix grammar
* Make position in menu more prominent
* original log directory was incorrect
I took the directory from usage.md but that is incorrect
* Updated the directory for the logs
Updated the directory for the logs
* added some text
and made it pretty
---------
Co-authored-by: NeonN3mesis <129052650+NeonN3mesis@users.noreply.github.com>
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* Add links to github issues in the README and clarify run instructions
* Rename agent subpackage to agents
* Revert all unwanted changes
* Use relative import in `agents/__init__.py`
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* Add links to github issues in the README and clarify run instructions
* Move things only used by the agent out of app.py and into the agent module
* Fix busted dynamic import
* Match requests in cassette by hash
* Strip requests more extensively for VCR
* Sort JSON keys on cassette save
* Strip max_tokens from cassettes
* Improve logging in retry decorator
* Raise when quota exceeded
* Clean up @retry_api
* Fix @retry_api
* Remove dead tests/vcr/openai_filter.py
* Add debug logging to execute_python_file
* Make Docker CI pass
* Move path argument sanitization for commands to a decorator
* Fix tests
* Add `@functools.wraps` to `@sanitize_path_arg` decorator
Co-authored-by: James Collins <collijk@uw.edu>
---------
Co-authored-by: James Collins <collijk@uw.edu>
* Consolidate all logging stuff into one module
* Merge import statement for `logs` and `logs.log_cycle`
---------
Co-authored-by: James Collins <collijk@uw.edu>
* Command name supports multiple names
* Separate CommandRegistry.commands and .command_aliases
* Update test_commands.py
* Add __contains__ operator to CommandRegistry
* Update error message for unknown commands
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* Document function get_memory in ./scripts/memory/init.py
* Update get_memory docstring to current format
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* changing configs names to tts_provider
* accidently triggered circular importing.
* added config to places it needs other than the logger
* got it to work on windows
* did all the formatting stuff
---------
Co-authored-by: James Collins <collijk@uw.edu>
* add capability to specify AI config at cmd line
* Make `--ai-goal` multi-parameter
* Fix argument forwarding in run.sh
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* [Fix] Recover the azure config load function
* [Style] Apply black, isort, mypy, autoflake
* [Fix] Rename the return parameter from 'azure_model_map' to 'azure_model_to_deployment_id_map'
* [Feat] Change the azure config file path to be dynamically configurable
* [Test] Add azure_config and azure deployment_id_for_model
* [Style] Apply black, isort, mypy, autoflake
* [Style] Apply black, isort, mypy, autoflake
* Refactor Azure configuration
- Refactor the `azure_config_file` attribute in the `Config` class to be optional.
- Refactor the `azure_model_to_deployment_id_map` attribute in the `Config` class to be optional and provide default values.
- Update the `get_azure_deployment_id_for_model` function to accept additional parameters.
- Update references to `get_azure_deployment_id_for_model` in `create_text_completion`, `create_chat_completion`, and `get_embedding` functions to pass the required parameters.
* Clean up process for azure
* Docstring
* revert some unneccessary fiddling
* Avoid altering args to models
* Retry on 404s
* Don't permanently change the environment
* Formatting
---------
Co-authored-by: Luke <2609441+lc0rp@users.noreply.github.com>
Co-authored-by: lc0rp <2609411+lc0rp@users.noreply.github.com>
Co-authored-by: collijk <collijk@uw.edu>
* Update setup.md
Change "docker-compose" command to "docker compose" to avoid future issues with running the Docker method (`docker-compose` is v1 and is outdated, is not a recognized command with newer versions of Docker engine)
* Update usage.md
* Update comment in docker-compose.yml
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* New Challenge test_information_retrieval_challenge_c
I created a new challenge needs a bit of work
* Update current_score.json
Changed max level beaten to null
* reformatted test_information_retrieval_challenge_c with black
reformatted test_information_retrieval_challenge_c with black
---------
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
Rough sketching out of a hello world using our refactored autogpt
library. See the tracking issue here: #4770.
# Run instructions
There are two client applications for Auto-GPT included.
## CLI Application
🌟 **This is the reference application I'm working with for now**
🌟
The first app is a straight CLI application. I have not done anything
yet to port all the friendly display stuff from the
`logger.typewriter_log` logic.
- [Entry
Point](https://github.com/Significant-Gravitas/Auto-GPT/blob/re-arch/hello-world/autogpt/core/runner/cli_app/cli.py)
- [Client
Application](https://github.com/Significant-Gravitas/Auto-GPT/blob/re-arch/hello-world/autogpt/core/runner/cli_app/main.py)
To run, you first need a settings file. Run
```
python REPOSITORY_ROOT/autogpt/core/runner/cli_app/cli.py make-settings
```
where `REPOSITORY_ROOT` is the root of the Auto-GPT repository on your machine. This will write a file called `default_agent_settings.yaml` with all the user-modifiable configuration keys to `~/auto-gpt/default_agent_settings.yml` and make the `auto-gpt` directory in your user directory if it doesn't exist). At a bare minimum, you'll need to set `openai.credentials.api_key` to your OpenAI API Key to run the model.
You can then run Auto-GPT with
```
python REPOSITORY_ROOT/autogpt/core/runner/cli_app/cli.py make-settings
```
to launch the interaction loop.
## CLI Web App
The second app is still a CLI, but it sets up a local webserver that the client application talks to rather than invoking calls to the Agent library code directly. This application is essentially a sketch at this point as the folks who were driving it have had less time (and likely not enough clarity) to proceed.
- [Entry Point](https://github.com/Significant-Gravitas/Auto-GPT/blob/re-arch/hello-world/autogpt/core/runner/cli_web_app/cli.py)
- [Client Application](https://github.com/Significant-Gravitas/Auto-GPT/blob/re-arch/hello-world/autogpt/core/runner/cli_web_app/client/client.py)
- [Server API](https://github.com/Significant-Gravitas/Auto-GPT/blob/re-arch/hello-world/autogpt/core/runner/cli_web_app/server/api.py)
To run, you still need to generate a default configuration. You can do
```
python REPOSITORY_ROOT/autogpt/core/runner/cli_web_app/cli.py
make-settings
```
It invokes the same command as the bare CLI app, so follow the instructions above about setting your API key.
To run, do
```
python REPOSITORY_ROOT/autogpt/core/runner/cli_web_app/cli.py client
```
This will launch a webserver and then start the client cli application to communicate with it.
⚠️ I am not actively developing this application. It is a very good place to get involved if you have web application design experience and are looking to get involved in the re-arch.
---------
Co-authored-by: David Wurtz <davidjwurtz@gmail.com>
Co-authored-by: Media <12145726+rihp@users.noreply.github.com>
Co-authored-by: Richard Beales <rich@richbeales.net>
Co-authored-by: Daryl Rodrigo <darylrodrigo@gmail.com>
Co-authored-by: Daryl Rodrigo <daryl@orkestro.com>
Co-authored-by: Swifty <craigswift13@gmail.com>
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: Merwane Hamadi <merwanehamadi@gmail.com>
As per
https://github.com/pydantic/pydantic/issues/1729#issuecomment-1300576214,
the implementation of `model_post_init()` is postponed until Pydantic
v2. As a result, the initialization of PluginConfig is being skipped.
This fix calls `plugin.model_post_init()` explicitly.
The recency of the Pydantic v2 release means that some of the other
extensions we use do not support it yet. Specifically, extensions such
as spacy and openapi-python-client are currently limited to Pydantic
versions that are less than 2.0. There may be other extensions that have
the same limitation as well.
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* Update OpenAI model info and remove duplicate modelsinfo.py (#4700)
* Update OpenAI model info and remove duplicate modelsinfo.py
* Fix max_tokens for gpt-4-0613
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
Co-authored-by: Merwane Hamadi <merwanehamadi@gmail.com>
* Update count_message_tokens to support new OpenAI models
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
Co-authored-by: Merwane Hamadi <merwanehamadi@gmail.com>
* Fix error message in count_message_tokens
---------
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
Co-authored-by: Erik Peterson <e@eriklp.com>
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
Further changes:
* remove `init` param from `get_memory()`, replace usages by `memory.clear()`
* make token length calculation optional in `MemoryItem.dump()`
* Extract open ai api calls and retry at lowest level
* Forgot a test
* Gotta fix my local docker config so I can let pre-commit hooks run, ugh
* fix: merge artiface
* Fix linting
* Update memory.vector.utils
* feat: make sure resp exists
* fix: raise error message if created
* feat: rename file
* fix: partial test fix
* fix: update comments
* fix: linting
* fix: remove broken test
* fix: require a model to exist
* fix: BaseError issue
* fix: runtime error
* Fix mock response in test_make_agent
* add 429 as errors to retry
---------
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
Co-authored-by: Nicholas Tindle <nicktindle@outlook.com>
Co-authored-by: Luke K (pr-0f3t) <2609441+lc0rp@users.noreply.github.com>
Co-authored-by: Merwane Hamadi <merwanehamadi@gmail.com>
* Correct and clean up JSON handling
* Use ast for message history too
* Lint
* Add comments explaining why we use literal_eval
* Add descriptions to llm_response_format schema
* Parse responses in code blocks
* Be more careful when parsing in code blocks
* Lint
* Implement Batch Running Summarization to avoid max token error (#4652)
* Fix extra space in prompt
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* Add config as attribute to Agent, rename old config to ai_config
* Code review: Pass ai_config
---------
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
* Add settings for custom base url and embedding dimension
Making the openai base url and embedding dimension configurable, these are useful to integrate AutoGPT with other models, like LLaMA
* Update to milvus.py to load the configuration also in the init_collection function
* Update radismem.py to get rid of Config() loading
* Update local.py to get rid of Config() loading
* Correct code format (python black)
* Revert DEFAULT_EMBED_DIM name to EMBED_DIM to keep tests valid
* Better description for EMBED_DIM setting
* Set MockConfig to the type Config in Milvus test
* Fix formatting
* Update Milvus test, using Config() instead of building a mock config
* using the last milvus test code from main
* Remove embed_dim , no more needed after #4208
* Add example for OPENAI_BASE_URL
---------
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
* False believes challenge based on sally anne test.
* Update test_memory_challenge_d.py
* Update challenge_d.md
Some text appearing in bold
* Update test_memory_challenge_d.py
* Update test_memory_challenge_d.py
* Update test_memory_challenge_d.py
* Update test_memory_challenge_d.py
black test_memory_challenge_d.py
* Update test_memory_challenge_d.py
replaced the dynamic time depending of the level to a fix time
* Update test_memory_challenge_d.py
isort command for the libraries
* Refactored memory challenge a
---------
Co-authored-by: Merwane Hamadi <merwanehamadi@gmail.com>
* feat: set max token limits for better user experience
* fix: use OPEN_AI_CHAT_MODELS max limits
* fix: use the old default of 8000
* fix: formatting so isort/black checks pass
* fix: avoid circular dependencies
* fix: use better to avoid circular imports
* feat: introduce soft limits and use them
* fix: circular import issue and missing field
* fix: move import to avoid overriding doc comment
* feat: DRY things up and set token limit for fast llm models too
* tests: make linter tests happy
* test: use the max token limits in config.py test
* fix: remove fast token limit from config
* feat: remove smart token limit from config
* fix: remove unused soft_token_limit var
* fix: remove unneeded tests, settings aren't in config anymore
---------
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* Fix issues with file reading and writing with Python code
* Change error message, use Workspace.get_path
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* Rearrange tests into unit/integration/challenge categories
* Fix linting + `tests.challenges` imports
* Fix obscured duplicate test in test_url_validation.py
* Move VCR conftest to tests.vcr
* Specify tests to run & their order (unit -> integration -> challenges) in CI
* Fail Docker CI when tests fail
* Fix import & linting errors in tests
* Fix `get_text_summary`
* Fix linting errors
* Clean up pytest args in CI
* Remove bogus tests from GoCodeo
* gfeat: specify directory of cassettes and automatically load them depending on module
fix: formatting for linter
test: commit newly generated cassettes to their respective folder
tests: update latest fixtures with master
fix: update .gitattributes with updated path to cassettes
fix: use cassettes from master instead of generating them myself
fix: update path in .gitattributes
fix: make sure to match default functionality by using test name for cassette directory
fix: actually add git submodule
ci: checkout git submodules in CI
ci: update git submodules separately to ensure it gets called
feat: add a hooks directory so we can update git submodules on post-checkout
feat: make sure we push the tests/cassettes submodule on merge into master
ci: remove unused code now that we are using git submodules to keep cassettes in sync
fix: simplify how we load the submodule and fix updating cassettes on merge to master
chore: remove echo of checkout hook, it's unneeded
ci: remove unneccesary step
* cassettes submodule
* cassettes submodule
* cassettes submodule
* cassettes submodule
* cassettes submodule
---------
Co-authored-by: Stefan Ayala <stefanayala3266@gmail.com>
* feat: pass config to call_ai_functions in coimmands
* feat: config for read_audio_from_file
* feat: file operations cfg
NOTE: we replaced the CFG in the command enable with TRUE b/c not sure how to handle this yet
* feat: git command conversion
* feat: google search
* feat: image generation
* feat: extract cfg from browser commands
* feat: remove cfg from execute code commands
* fix: file operation related tests
* fix: linting
* fix: tests for read_audio
* fix: test error
* feat: update cassettes
* fix: linting
* fix: test typechecking
* fix: google_search errors if unexpected kw arg is passed
* fix: pass config param to google search test
* fix: agent commands were broken + cassettes
* fix: agent test
* feat: cassettes
* feat: enable/disable logic for commands
* fix: some commands threw errors
* feat: fix tests
* Add new cassettes
* Add new cassettes
* ci: trigger ci
* Update autogpt/commands/execute_code.py
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* fix prompt
* fix prompt + rebase
* add config remove useless imports
* put back CFG just for download file
* lint
* The signature should be mandatory in the decorator
* black isort
* fix: remove the CFG
* fix: non typed arg
* lint: type some args
* lint: add types for libraries
* Add new cassettes
* fix: windows compatibility
* fix: add config access to decorator
* fix: remove twitter mention
* DDGS search works at 3.0.2 version
* ci: linting
---------
Co-authored-by: Auto-GPT-Bot <github-bot@agpt.co>
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
Co-authored-by: kinance <kinance@gmail.com>
* fix ci
* fix ci
* add only what we need
* Updated ci.yml to inform about challenge score
* Updated ci.yml to inform about challenge score
---------
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
* Update 1.bug.yml to improve consistency of data
in this version of the bug report several dropdown fileds have been added and text fields have been removed to have better control over the data being sent in bug reports
* Update 1.bug.yml fixing indent error
fixing of an indent error
* Update 1.bug.yml
changed the file uploads to input fields for the log contents since files are not supported on github
* Update 1.bug.yml
made the issue field required
* Update 1.bug.yml
Added changes according to luke's comments
---------
Co-authored-by: Pi <sunfish7@gmail.com>
* adding requiered packages for loading pdf, docx, md, tex files (preferably pure python packages)
* adding text file utils providing function to load file based on extension && adding read_text_file command
* adding test cases for text file loading (pdf file creation is hardcoded due to external package requierment for creation (a sample file can be added))
* formatting
* changing command name from 'read_text_file' to 'parse_text_document'
* fallback to txtParser if file extension is not known to read script and code files
* adding extension respective parsers
* adding binary file check function
* adding file existance check && raising valueError for unsupported binary file formats
* adding check file type (binary) in test_parsers for specific extensions && fixing mock pdf generation to include null bytes
* adding .yml extension parser
* removal of .doc parser
* updating file loading commands names
* updating test (removing .doc mock function)
* fix: import sort
* new cassette for mem A
* feat: update Cassettes
* feat: consolidate commands
* feat: linting
* feat: updates to cassettes
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
* Updated run script to check for Python 3.10 and above, and provide informative error messages for unsupported versions.
* Updated run script to check for Python 3.10 and above, and provide informative error messages for unsupported versions.
---------
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
Maybe I'm missing something but I don't see the harm of accessing an absolute path if it's contained in the workspace
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
* Update prompt.py to clarify how to call commands
* new cassettes
* try again with a new cassette
* one last try with the cassette
* black dot
---------
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
* Feature/tighten up ci pipeline (#3700)
* Fix docker volume mounts (#3710)
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
* Feature/enable intuitive logs for community challenge step 1 (#3695)
* Feature/enable intuitive logs summarization (#3697)
* Move task_complete command out of prompt (#3663)
* feat: move task_complete command out of prompt
* fix: formatting fixes
* Add the shutdown command to the test agents
* tests: update test vcrs
---------
Co-authored-by: James Collins <collijk@uw.edu>
* Allow users to Disable Commands via the .env (#3667)
* Document Disabling command categories (#3669)
* feat: move task_complete command out of prompt
* fix: formatting fixes
* feat: add command disabling
* docs: document how to disable command categories
* Enable denylist handling for plugins (#3688)
Co-authored-by: Luke Kyohere <lkyohere@mfsafrica.com>
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
* Fix call to `plugin.post_planning` (#3414)
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
* create information retrieval challenge a (#3770)
Co-authored-by: Richard Beales <rich@richbeales.net>
* fix typos (#3798)
* Update run.bat (#3783)
Co-authored-by: Richard Beales <rich@richbeales.net>
* Update run.sh (#3752)
Co-authored-by: Richard Beales <rich@richbeales.net>
* ADD: Bash block in the contributing markdown (#3701)
Co-authored-by: Richard Beales <rich@richbeales.net>
* BUGFIX: Selenium Driver object reference was included in the browsing results for some reason (#3642)
* * there is really no need to return the reference to the Selenium driver along with the text summary and list of links.
* * removing unused second return value from browse_website()
* * updated cassette
* * updated YAML cassette for test_browse_website
* * after requirements reinstall, another update YAML cassette for test_browse_website
* * another update YAML cassette for test_browse_website, only as a placholder commit to trigger re-testing due to some docker TCP timeout issue
* * another update YAML cassette for test_browse_website
---------
Co-authored-by: batyu <batyu@localhost>
* Update CONTRIBUTING.md
* Self feedback Improvement (#3680)
* Improved `Self-Feedback`
* minor tweak
* Test: Updated `test_get_self_feedback.py`
* community challenges in the wiki (#3764)
* Update README.md
* Update PULL_REQUEST_TEMPLATE.md
Added link to wiki Contributing page
* Add link to wiki Contributing page
* fix
* Add link to wiki page on Contributing
* Implement Logging of User Input in logs/Debug Folder (#3867)
* Adds USER_INPUT_FILE_NAME
* Update agent.py
* Update agent.py
Log only if console_input is not the authorise_key
* Reformatting
* add information retrieval challenge to the wiki (#3876)
* add code owners policy (#3981)
* add code owners
* added @ to codeowners
* switched to team ownership
* Memory Challenge C (#3908)
* Memory Challenge C
* Working cassettes
* Doc fixes
* Linting and doc fix
* Updated cassette
* One more cassette try
---------
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
* memory challenge c inconsistent (#3985)
* Improve & fix memory challenge docs. (#3989)
Co-authored-by: Kaan Osmanagaoglu <kaano@questps.com.au>
* Feature/centralize prompt (#3990)
Co-authored-by: xiao.hu <454292663@qq.com>
* Use correct reference to prompt_generator in autogpt/llm/chat.py (#4011)
* fix typos (#3998)
Co-authored-by: Minfeng Lu <minfenglu@Minfengs-MacBook-Pro.local>
Co-authored-by: Richard Beales <rich@richbeales.net>
* fix typo in the getting started docs (#3997)
Co-authored-by: Richard Beales <rich@richbeales.net>
* Fix path to workspace directory in setup guide (#3927)
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
* document that docker-compose 1.29.0 is minimally required (#3963)
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
* Integrate pytest-xdist Plugin for Parallel and Concurrent Testing (#3870)
* Adds pytest-parallel dependencies
* Implement pytest-parallel for faster tests
* Uses pytest-xdist
* Auto number of workers processes
* Update ci.yml
---------
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
* explain temperature setting in env file (#4140)
Co-authored-by: Richard Beales <rich@richbeales.net>
* Catch JSON error in summary_memory.py (#3996)
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
* Update duckduckgo dependency - min should be 2.9.5 (#4142)
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
* Update Dockerfile - add missing scripts and plugins directories. (#3706)
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
* Updated memory setup links (#3829)
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
* Parse package versions so upgrades can be forced (#4149)
* parse package versions so upgrades can be forced
* better version from @collijk
* fix typo in autopgt/agent/agent.py (#3747)
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
Co-authored-by: Richard Beales <rich@richbeales.net>
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
* Fix `milvus_memory_test.py` mock `Config` (#3424)
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
* Implemented showing the number of preauthorised commands left. #1035 (#3322)
Co-authored-by: mayubi <marwand@ayubi-it.de>
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
* Challenge: Kubernetes and documentation (#4121)
* challenge_kubes_and_readme
* docs
* testing
* black and isort
* revision
* lint
* comments
* blackisort
* docs
* docs
* deleting_cassette
* suggestions
* misspelling_errors
---------
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
* Make sdwebui tests pass (when SD is running) (#3721)
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
* Add Edge browser support using EdgeChromiumDriverManager (#3058)
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
* Added --install-plugin-deps to Docker (#4151)
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
* Feature/basic proxy (#4164)
* basic proxy (#54)
* basic proxy (#55)
* basic proxy
* basic proxy
* basic proxy
* basic proxy
* add back double quotes
* add more specific files
* write file
* basic proxy
* Put back double quotes
* test new CI (#4168)
* test new CI
* test new CI
* remove double quotes
* Feature/test new ci pipeline 2 (#4169)
* test new CI
* remove double quotes
* make it a variable
* make it a variable
* Test New CI Pipeline (#4170)
* introduce dummy prompt change
* introduce dummy prompt change
* empty commit
* empty commit
* empty commit
* push to origin repo
* add s to quote
* Feature/fix rate limiting issue Step 1 (#4173)
* temporarilly remove 3.11
* add back 3.11 (#4185)
* Revert "Put back 3.11 until it's removed as a requirement" (#4191)
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
Co-authored-by: Peter Petermann <ppetermann80@googlemail.com>
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: James Collins <collijk@uw.edu>
Co-authored-by: Luke K <2609441+pr-0f3t@users.noreply.github.com>
Co-authored-by: Luke Kyohere <lkyohere@mfsafrica.com>
Co-authored-by: Robin Richtsfeld <robin.richtsfeld@gmail.com>
Co-authored-by: RainRat <rainrat78@yahoo.ca>
Co-authored-by: itsmarble <130370814+itsmarble@users.noreply.github.com>
Co-authored-by: Ambuj Pawar <pawar.ambuj@gmail.com>
Co-authored-by: bszollosinagy <4211175+bszollosinagy@users.noreply.github.com>
Co-authored-by: batyu <batyu@localhost>
Co-authored-by: Pi <sunfish7@gmail.com>
Co-authored-by: AbTrax <45964236+AbTrax@users.noreply.github.com>
Co-authored-by: Andres Caicedo <73312784+AndresCdo@users.noreply.github.com>
Co-authored-by: Douglas Schonholtz <15002691+dschonholtz@users.noreply.github.com>
Co-authored-by: Kaan <kaanixir@gmail.com>
Co-authored-by: Kaan Osmanagaoglu <kaano@questps.com.au>
Co-authored-by: xiao.hu <454292663@qq.com>
Co-authored-by: Tomasz Kasperczyk <tomaszikasperczyk@gmail.com>
Co-authored-by: minfeng-ai <42948406+minfenglu@users.noreply.github.com>
Co-authored-by: Minfeng Lu <minfenglu@Minfengs-MacBook-Pro.local>
Co-authored-by: Shlomi <81581678+jit-shlomi@users.noreply.github.com>
Co-authored-by: Itai Steinherz <itaisteinherz@gmail.com>
Co-authored-by: Boostrix <119627414+Boostrix@users.noreply.github.com>
Co-authored-by: Kristian Jackson <kristian.jackson@gmail.com>
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
Co-authored-by: Eduardo Salinas <edus@microsoft.com>
Co-authored-by: prom3theu5 <dave@simcube.co.uk>
Co-authored-by: dominic-ks <contact@bedevious.co.uk>
Co-authored-by: andrey13771 <51243350+andrey13771@users.noreply.github.com>
Co-authored-by: Marwand Ayubi <98717667+xhypeDE@users.noreply.github.com>
Co-authored-by: mayubi <marwand@ayubi-it.de>
Co-authored-by: Media <12145726+rihp@users.noreply.github.com>
Co-authored-by: Cenny <cwenner@gmail.com>
Co-authored-by: Abdelkarim Habouch <37211852+karimhabush@users.noreply.github.com>
* * there is really no need to return the reference to the Selenium driver along with the text summary and list of links.
* * removing unused second return value from browse_website()
* * updated cassette
* * updated YAML cassette for test_browse_website
* * after requirements reinstall, another update YAML cassette for test_browse_website
* * another update YAML cassette for test_browse_website, only as a placholder commit to trigger re-testing due to some docker TCP timeout issue
* * another update YAML cassette for test_browse_website
---------
Co-authored-by: batyu <batyu@localhost>
* feat: move task_complete command out of prompt
* fix: formatting fixes
* Add the shutdown command to the test agents
* tests: update test vcrs
---------
Co-authored-by: James Collins <collijk@uw.edu>
## HEADLESS_BROWSER - Whether to run the browser in headless mode (default: True)
## USE_WEB_BROWSER - Sets the web-browser driver to use with selenium (default: chrome).
## Note: set this to either 'chrome', 'firefox', or 'safari' depending on your current browser
# HEADLESS_BROWSER=True
# USE_WEB_BROWSER=chrome
## BROWSE_CHUNK_MAX_LENGTH - When browsing website, define the length of chunks to summarize (in number of tokens, excluding the response. 75 % of FAST_TOKEN_LIMIT is usually wise )
# BROWSE_CHUNK_MAX_LENGTH=3000
## BROWSE_SPACY_LANGUAGE_MODEL is used to split sentences. Install additional languages via pip, and set the model name here. Example Chinese: python -m spacy download zh_core_web_sm
# BROWSE_SPACY_LANGUAGE_MODEL=en_core_web_sm
### GOOGLE
## GOOGLE_API_KEY - Google API key (Example: my-google-api-key)
## CUSTOM_SEARCH_ENGINE_ID - Custom search engine ID (Example: my-custom-search-engine-id)
[wiki page on Contributing]: https://github.com/Significant-Gravitas/AutoGPT/wiki/Contributing
- type:checkboxes
attributes:
label:⚠️ Search for existing issues first ⚠️
description:>
Please [search the history](https://github.com/Torantulino/Auto-GPT/issues)
Please [search the history](https://github.com/Significant-Gravitas/AutoGPT/issues)
to see if an issue already exists for the same problem.
options:
- label:I have searched the existing issues, and there is no existing issue for my problem
required:true
- type:markdown
attributes:
value:|
Please provide a searchable summary of the issue in the title above ⬆️.
⚠️ SUPER-busy repo, please help the volunteer maintainers.
The less time we spend here, the more time we spend building AutoGPT.
Please confirm that the issue you have is described well and precise in the title above ⬆️.
A good rule of thumb: What would you type if you were searching for the issue?
Please help us help you:
- Does it work on `stable` branch (https://github.com/Torantulino/Auto-GPT/tree/stable)?
- Does it work on current `master` (https://github.com/Torantulino/Auto-GPT/tree/master)?
- Search for existing issues, "add comment" is tidier than "new issue"
- Ask on our Discord (https://discord.gg/autogpt)
For example:
BAD - my AutoGPT keeps looping
GOOD - After performing execute_python_file, AutoGPT goes into a loop where it keeps trying to execute the file.
⚠️ SUPER-busy repo, please help the volunteer maintainers.
The less time we spend here, the more time we can spend building AutoGPT.
Please help us help you by following these steps:
- Search for existing issues, adding a comment when you have the same or similar issue is tidier than "new issue" and
newer issues will not be reviewed earlier, this is dependent on the current priorities set by our wonderful team
- Ask on our Discord if your issue is known when you are unsure (https://discord.gg/autogpt)
- Provide relevant info:
- Provide commit-hash (`git rev-parse HEAD` gets it)
- If it's a pip/packages issue, provide pip version, python version
- If it's a crash, provide traceback.
- Provide commit-hash (`git rev-parse HEAD` gets it) if possible
- If it's a pip/packages issue, mention this in the title and provide pip version, python version
- If it's a crash, provide traceback and describe the error you got as precise as possible in the title.
- type:dropdown
attributes:
label:Which Operating System are you using?
description:>
Please select the operating system you were using to run Auto-GPT when this problem occurred.
Please select the operating system you were using to run AutoGPT when this problem occurred.
options:
- Windows
- Linux
@@ -54,78 +62,112 @@ body:
- Docker
- Devcontainer / Codespace
- Windows Subsystem for Linux (WSL)
- Other (Please specify in your problem)
- Other
validations:
required:true
nested_fields:
- type:text
attributes:
label:Specify the system
description:Please specify the system you are working on.
- type:dropdown
attributes:
label:Which version of Auto-GPT are you using?
label:Which version of AutoGPT are you using?
description:|
Please select which version of Auto-GPT you were using when this issue occurred.
If you downloaded the code from the [releases page](https://github.com/Significant-Gravitas/Auto-GPT/releases/) make sure you were using the latest code.
**If you weren't please try with the [latest code](https://github.com/Significant-Gravitas/Auto-GPT/releases/)**.
If installed with git you can run `git branch` to see which version of Auto-GPT you are running.
Please select which version of AutoGPT you were using when this issue occurred.
If you downloaded the code from the [releases page](https://github.com/Significant-Gravitas/AutoGPT/releases/) make sure you were using the latest code.
**If you weren't please try with the [latest code](https://github.com/Significant-Gravitas/AutoGPT/releases/)**.
If installed with git you can run `git branch` to see which version of AutoGPT you are running.
options:
- Latest Release
- Stable (branch)
- Master (branch)
validations:
required:true
- type:dropdown
attributes:
label:GPT-3 or GPT-4?
label:What LLM Provider do you use?
description:>
If you are using Auto-GPT with `--gpt3only`, your problems may be caused by
the [limitations](https://github.com/Significant-Gravitas/Auto-GPT/issues?q=is%3Aissue+label%3A%22AI+model+limitation%22) of GPT-3.5.
If you are using AutoGPT with `SMART_LLM=gpt-3.5-turbo`, your problems may be caused by
the [limitations](https://github.com/Significant-Gravitas/AutoGPT/issues?q=is%3Aissue+label%3A%22AI+model+limitation%22) of GPT-3.5.
options:
- GPT-3.5
- GPT-4
- Azure
- Groq
- Anthropic
- Llamafile
- Other (detail in issue)
validations:
required:true
- type:textarea
- type:dropdown
attributes:
label:Steps to reproduce 🕹
description:|
**⚠️ Issues that we can't reproduce will be closed.**
- type:textarea
attributes:
label:Current behavior 😯
description:Describe what happens instead of the expected behavior.
- type:textarea
attributes:
label:Expected behavior 🤔
description:Describe what should happen.
- type:textarea
attributes:
label:Your prompt 📝
label:Which area covers your issue best?
description:>
If applicable please provide the prompt you are using. Your prompt is stored in your `ai_settings.yaml` file.
value:|
```yaml
# Paste your prompt here
```
Select the area related to the issue you are reporting.
options:
- Installation and setup
- Memory
- Performance
- Prompt
- Commands
- Plugins
- AI Model Limitations
- Challenges
- Documentation
- Logging
- Agents
- Other
validations:
required:true
autolabels:true
nested_fields:
- type:text
attributes:
label:Specify the area
description:Please specify the area you think is best related to the issue.
- type:input
attributes:
label:What commit or version are you using?
description:It is helpful for us to reproduce to know what version of the software you were using when this happened. Please run `git log -n 1 --pretty=format:"%H"` to output the full commit hash.
validations:
required:true
- type:textarea
attributes:
label:Your Logs 📒
description:|
Please include the log showing your error and the command that caused it, if applicable.
You can copy it from your terminal or from `logs/activity.log`.
This will help us understand your issue better!
<details>
<summary><i>Example</i></summary>
```log
INFO NEXT ACTION: COMMAND = execute_shell ARGUMENTS = {'command_line': 'some_command'}
INFO -=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-=
Traceback (most recent call last):
File "/home/anaconda3/lib/python3.9/site-packages/openai/api_requestor.py", line 619, in _interpret_response
self._interpret_response_line(
File "/home/anaconda3/lib/python3.9/site-packages/openai/api_requestor.py", line 682, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: This model's maximum context length is 8191 tokens, however you requested 10982 tokens (10982 in your prompt; 0 for the completion). Please reduce your prompt; or completion length.
```
</details>
label:Describe your issue.
description:Describe the problem you are experiencing. Try to describe only the issue and phrase it short but clear. ⚠️ Provide NO other data in this field
validations:
required:true
#Following are optional file content uploads
- type:markdown
attributes:
value:|
```log
<insert your logs here>
```
⚠️The following is OPTIONAL, please keep in mind that the log files may contain personal information such as credentials.⚠️
"The log files are located in the folder 'logs' inside the main AutoGPT folder."
- type:textarea
attributes:
label:Upload Activity Log Content
description:|
Upload the activity log content, this can help us understand the issue better.
To do this, go to the folder logs in your main AutoGPT folder, open activity.log and copy/paste the contents to this field.
⚠️ The activity log may contain personal data given to AutoGPT by you in prompt or input as well as
any personal information that AutoGPT collected out of files during last run. Do not add the activity log if you are not comfortable with sharing it. ⚠️
validations:
required:false
- type:textarea
attributes:
label:Upload Error Log Content
description:|
Upload the error log content, this will help us understand the issue better.
To do this, go to the folder logs in your main AutoGPT folder, open error.log and copy/paste the contents to this field.
⚠️ The error log may contain personal data given to AutoGPT by you in prompt or input as well as
any personal information that AutoGPT collected out of files during last run. Do not add the activity log if you are not comfortable with sharing it. ⚠️
First, check out our [wiki page on Contributing](https://github.com/Significant-Gravitas/AutoGPT/wiki/Contributing)
Please provide a searchable summary of the issue in the title above ⬆️.
Thanks for contributing by creating an issue! ❤️
- type:checkboxes
attributes:
label:Duplicates
description:Please [search the history](https://github.com/Torantulino/Auto-GPT/issues) to see if an issue already exists for the same problem.
description:Please [search the history](https://github.com/Significant-Gravitas/AutoGPT/issues) to see if an issue already exists for the same problem.
options:
- label:I have searched the existing issues
required:true
@@ -26,4 +25,4 @@ body:
- type:textarea
attributes:
label:Motivation 🔦
description:What are you trying to accomplish? How has the lack of this feature affected you? Providing context helps us come up with a solution that is more useful in the real world.
description:What are you trying to accomplish? How has the lack of this feature affected you? Providing context helps us come up with a solution that is more useful in the real world.
2. Also consider contributing something other than code; see the [contribution guide]
for options.
3. Clearly explain your changes.
4. Avoid making unnecessary changes, especially if they're purely based on personal
preferences. Doing so is the maintainers' job. ;-)
-->
<!-- 📢 Announcement
We've recently noticed an increase in pull requests focusing on combining multiple changes. While the intentions behind these PRs are appreciated, it's essential to maintain a clean and manageable git history. To ensure the quality of our repository, we kindly ask you to adhere to the following guidelines when submitting PRs:
Focus on a single, specific change.
Do not include any unrelated or "extra" modifications.
Provide clear documentation and explanations of the changes made.
Ensure diffs are limited to the intended lines — no applying preferred formatting styles or line endings (unless that's what the PR is about).
For guidance on committing only the specific lines you have changed, refer to this helpful video: https://youtu.be/8-hSNHHbiZg
By following these guidelines, your PRs are more likely to be merged quickly after testing, as long as they align with the project's overall direction. -->
### Background
<!-- Provide a concise overview of the rationale behind this change. Include relevant context, prior discussions, or links to related issues. Ensure that the change aligns with the project's overall direction. -->
### Changes
<!-- Describe the specific, focused change made in this pull request. Detail the modifications clearly and avoid any unrelated or "extra" changes. -->
### Documentation
<!-- Explain how your changes are documented, such as in-code comments or external documentation. Ensure that the documentation is clear, concise, and easy to understand. -->
### Test Plan
<!-- Describe how you tested this functionality. Include steps to reproduce, relevant test cases, and any other pertinent information. -->
### PR Quality Checklist
- [ ] My pull request is atomic and focuses on a single change.
- [ ] I have thoroughly tested my changes with multiple different prompts.
- [ ] I have considered potential risks and mitigations for my changes.
- [ ] I have documented my changes clearly and comprehensively.
- [ ] I have not snuck in any "extra" small tweaks changes <!-- Submit these as separate Pull Requests, they are the easiest to merge! -->
<!-- If you haven't added tests, please explain why. If you have, check the appropriate box. If you've ensured your PR is atomic and well-documented, check the corresponding boxes. -->
<!-- By submitting this, I agree that my pull request should be closed if I do not fill this out or follow the guidelines. -->
- [x] Have you used the PR description template?   `+2 pts`
- [ ] Is your pull request atomic, focusing on a single change?   `+5 pts`
- [ ] Have you linked the GitHub issue(s) that this PR addresses?   `+5 pts`
- [ ] Have you documented your changes clearly and comprehensively?   `+5 pts`
- [ ] Have you changed or added a feature?   `-4 pts`
- [ ] Have you added/updated corresponding documentation?   `+4 pts`
- [ ] Have you added/updated corresponding integration tests?   `+5 pts`
- [ ] Have you changed the behavior of AutoGPT?   `-5 pts`
- [ ] Have you also run `agbenchmark` to verify that these changes do not regress performance?   `+10 pts`
set +e # Ignore non-zero exit codes and continue execution
echo "Running the following command: poetry run agbenchmark --maintain --mock"
poetry run agbenchmark --maintain --mock
EXIT_CODE=$?
set -e # Stop ignoring non-zero exit codes
# Check if the exit code was 5, and if so, exit with 0 instead
if [ $EXIT_CODE -eq 5 ]; then
echo "regression_tests.json is empty."
fi
echo "Running the following command: poetry run agbenchmark --mock"
poetry run agbenchmark --mock
echo "Running the following command: poetry run agbenchmark --mock --category=data"
poetry run agbenchmark --mock --category=data
echo "Running the following command: poetry run agbenchmark --mock --category=coding"
poetry run agbenchmark --mock --category=coding
echo "Running the following command: poetry run agbenchmark --test=WriteFile"
poetry run agbenchmark --test=WriteFile
cd ../benchmark
poetry install
echo "Adding the BUILD_SKILL_TREE environment variable. This will attempt to add new elements in the skill tree. If new elements are added, the CI fails because they should have been pushed"
gh issue comment $PR_NUMBER --body "You changed AutoGPT's behaviour on ${{ runner.os }}. The cassettes have been updated and will be merged to the submodule when this Pull Request gets merged."
This document describes how to interact with the project's CLI (Command Line Interface). It includes the types of outputs you can expect from each command. Note that the `agents stop` command will terminate any process running on port 8000.
### 1. Entry Point for the CLI
Running the `./run` command without any parameters will display the help message, which provides a list of available commands and options. Additionally, you can append `--help` to any command to view help information specific to that command.
```sh
./run
```
**Output**:
```
Usage: cli.py [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
agent Commands to create, start and stop agents
benchmark Commands to start the benchmark and list tests and categories
setup Installs dependencies needed for your system.
```
If you need assistance with any command, simply add the `--help` parameter to the end of your command, like so:
```sh
./run COMMAND --help
```
This will display a detailed help message regarding that specific command, including a list of any additional options and arguments it accepts.
### 2. Setup Command
```sh
./run setup
```
**Output**:
```
Setup initiated
Installation has been completed.
```
This command initializes the setup of the project.
### 3. Agents Commands
**a. List All Agents**
```sh
./run agent list
```
**Output**:
```
Available agents: 🤖
🐙 forge
🐙 autogpt
```
Lists all the available agents.
**b. Create a New Agent**
```sh
./run agent create my_agent
```
**Output**:
```
🎉 New agent 'my_agent' created and switched to the new directory in agents folder.
```
Creates a new agent named 'my_agent'.
**c. Start an Agent**
```sh
./run agent start my_agent
```
**Output**:
```
... (ASCII Art representing the agent startup)
[Date and Time] [forge.sdk.db] [DEBUG] 🐛 Initializing AgentDB with database_string: sqlite:///agent.db
[Date and Time] [forge.sdk.agent] [INFO] 📝 Agent server starting on http://0.0.0.0:8000
```
Starts the 'my_agent' and displays startup ASCII art and logs.
**d. Stop an Agent**
```sh
./run agent stop
```
**Output**:
```
Agent stopped
```
Stops the running agent.
### 4. Benchmark Commands
**a. List Benchmark Categories**
```sh
./run benchmark categories list
```
**Output**:
```
Available categories: 📚
📖 code
📖 safety
📖 memory
... (and so on)
```
Lists all available benchmark categories.
**b. List Benchmark Tests**
```sh
./run benchmark tests list
```
**Output**:
```
Available tests: 📚
📖 interface
🔬 Search - TestSearch
🔬 Write File - TestWriteFile
... (and so on)
```
Lists all available benchmark tests.
**c. Show Details of a Benchmark Test**
```sh
./run benchmark tests details TestWriteFile
```
**Output**:
```
TestWriteFile
-------------
Category: interface
Task: Write the word 'Washington' to a .txt file
... (and other details)
```
Displays the details of the 'TestWriteFile' benchmark test.
**d. Start Benchmark for the Agent**
```sh
./run benchmark start my_agent
```
**Output**:
```
(more details about the testing process shown whilst the test are running)
============= 13 failed, 1 passed in 0.97s ============...
```
Displays the results of the benchmark tests on 'my_agent'.
The purpose of this Code of Conduct is to provide guidelines for contributors to the auto-gpt project on GitHub. We aim to create a positive and inclusive environment where all participants can contribute and collaborate effectively. By participating in this project, you agree to abide by this Code of Conduct.
The purpose of this Code of Conduct is to provide guidelines for contributors to the AutoGPT projects on GitHub. We aim to create a positive and inclusive environment where all participants can contribute and collaborate effectively. By participating in this project, you agree to abide by this Code of Conduct.
## 2. Scope
This Code of Conduct applies to all contributors, maintainers, and users of the auto-gpt project. It extends to all project spaces, including but not limited to issues, pull requests, code reviews, comments, and other forms of communication within the project.
This Code of Conduct applies to all contributors, maintainers, and users of the AutoGPT project. It extends to all project spaces, including but not limited to issues, pull requests, code reviews, comments, and other forms of communication within the project.
## 3. Our Standards
@@ -36,4 +36,5 @@ This Code of Conduct is adapted from the [Contributor Covenant](https://www.cont
## 6. Contact
If you have any questions or concerns, please contact the project maintainers.
If you have any questions or concerns, please contact the project maintainers on Discord:
If you are reading this, you are probably looking for the full **[contribution guide]**,
which is part of our [wiki].
First of all, thank you for considering contributing to our project! We appreciate your time and effort, and we value any contribution, whether it's reporting a bug, suggesting a new feature, or submitting a pull request.
Also check out our [🚀 Roadmap][roadmap] for information about our priorities and associated tasks.
<!-- You can find our immediate priorities and their progress on our public [kanban board]. -->
This document provides guidelines and best practices to help you contribute effectively.
2. We encourage you to collaborate with fellow community members on some of our bigger
[todo's][roadmap]!
* We highly recommend to post your idea and discuss it in the [dev channel].
3. Create a draft PR when starting work on bigger changes.
4. Adhere to the [Code Guidelines]
5. Clearly explain your changes when submitting a PR.
6. Don't submit broken code: test/validate your changes.
7. Avoid making unnecessary changes, especially if they're purely based on your personal
preferences. Doing so is the maintainers' job. ;-)
8. Please also consider contributing something other than code; see the
[contribution guide] for options.
By participating in this project, you agree to abide by our [Code of Conduct]. Please read it to understand the expectations we have for everyone who contributes to this project.
[Code of Conduct]: https://significant-gravitas.github.io/Auto-GPT/code-of-conduct.md
If you wish to involve with the project (beyond just contributing PRs), please read the
wiki page about [Catalyzing](https://github.com/Significant-Gravitas/AutoGPT/wiki/Catalyzing).
## 📢 A Quick Word
Right now we will not be accepting any Contributions that add non-essential commands to Auto-GPT.
In fact, why not just look through the whole wiki (it's only a few pages) and
hop on our Discord. See you there! :-)
However, you absolutely can still add these commands to Auto-GPT in the form of plugins.
Please check out this [template](https://github.com/Significant-Gravitas/Auto-GPT-Plugin-Template).
## Getting Started
1. Fork the repository and clone your fork.
2. Create a new branch for your changes (use a descriptive name, such as `fix-bug-123` or `add-new-feature`).
3. Make your changes in the new branch.
4. Test your changes thoroughly.
5. Commit and push your changes to your fork.
6. Create a pull request following the guidelines in the [Submitting Pull Requests](#submitting-pull-requests) section.
## How to Contribute
### Reporting Bugs
If you find a bug in the project, please create an issue on GitHub with the following information:
- A clear, descriptive title for the issue.
- A description of the problem, including steps to reproduce the issue.
- Any relevant logs, screenshots, or other supporting information.
### Suggesting Enhancements
If you have an idea for a new feature or improvement, please create an issue on GitHub with the following information:
- A clear, descriptive title for the issue.
- A detailed description of the proposed enhancement, including any benefits and potential drawbacks.
- Any relevant examples, mockups, or supporting information.
### Submitting Pull Requests
When submitting a pull request, please ensure that your changes meet the following criteria:
- Your pull request should be atomic and focus on a single change.
- Your pull request should include tests for your change. We automatically enforce this with [CodeCov](https://docs.codecov.com/docs/commit-status)
- You should have thoroughly tested your changes with multiple different prompts.
- You should have considered potential risks and mitigations for your changes.
- You should have documented your changes clearly and comprehensively.
- You should not include any unrelated or "extra" small tweaks or changes.
## Style Guidelines
### Code Formatting
We use the `black` and `isort` code formatters to maintain a consistent coding style across the project. Please ensure that your code is formatted properly before submitting a pull request.
To format your code, run the following commands in the project's root directory:
```bash
python -m black .
python -m isort .
```
Or if you have these tools installed globally:
```bash
black .
isort .
```
### Pre-Commit Hooks
We use pre-commit hooks to ensure that code formatting and other checks are performed automatically before each commit. To set up pre-commit hooks for this project, follow these steps:
Install the pre-commit package using pip:
```bash
pip install pre-commit
```
Run the following command in the project's root directory to install the pre-commit hooks:
```bash
pre-commit install
```
Now, the pre-commit hooks will run automatically before each commit, checking your code formatting and other requirements.
If you encounter any issues or have questions, feel free to reach out to the maintainers or open a new issue on GitHub. We're here to help and appreciate your efforts to contribute to the project.
Happy coding, and once again, thank you for your contributions!
Maintainers will look at PR that have no merge conflicts when deciding what to add to the project. Make sure your PR shows up here:
> For the complete getting started [tutorial series](https://aiedge.medium.com/autogpt-forge-e3de53cc58ec) <- click here
Welcome to the Quickstart Guide! This guide will walk you through setting up, building, and running your own AutoGPT agent. Whether you're a seasoned AI developer or just starting out, this guide will provide you with the steps to jumpstart your journey in AI development with AutoGPT.
## System Requirements
This project supports Linux (Debian-based), Mac, and Windows Subsystem for Linux (WSL). If you use a Windows system, you must install WSL. You can find the installation instructions for WSL [here](https://learn.microsoft.com/en-us/windows/wsl/).
- On the next page, select your GitHub account to create the fork.
- Wait for the forking process to complete. You now have a copy of the repository in your GitHub account.
2.**Clone the Repository**
To clone the repository, you need to have Git installed on your system. If you don't have Git installed, download it from [here](https://git-scm.com/downloads). Once you have Git installed, follow these steps:
- Open your terminal.
- Navigate to the directory where you want to clone the repository.
- Run the git clone command for the fork you just created

- Then open your project in your ide

4.**Setup the Project**
Next, we need to set up the required dependencies. We have a tool to help you perform all the tasks on the repo.
It can be accessed by running the `run` command by typing `./run` in the terminal.
The first command you need to use is `./run setup.` This will guide you through setting up your system.
Initially, you will get instructions for installing Flutter and Chrome and setting up your GitHub access token like the following image:

### For Windows Users
If you're a Windows user and experience issues after installing WSL, follow the steps below to resolve them.
#### Update WSL
Run the following command in Powershell or Command Prompt:
1. Enable the optional WSL and Virtual Machine Platform components.
2. Download and install the latest Linux kernel.
3. Set WSL 2 as the default.
4. Download and install the Ubuntu Linux distribution (a reboot may be required).
```shell
wsl --install
```
For more detailed information and additional steps, refer to [Microsoft's WSL Setup Environment Documentation](https://learn.microsoft.com/en-us/windows/wsl/setup/environment).
#### Resolve FileNotFoundError or "No such file or directory" Errors
When you run `./run setup`, if you encounter errors like `No such file or directory` or `FileNotFoundError`, it might be because Windows-style line endings (CRLF - Carriage Return Line Feed) are not compatible with Unix/Linux style line endings (LF - Line Feed).
To resolve this, you can use the `dos2unix` utility to convert the line endings in your script from CRLF to LF. Here’s how to install and run `dos2unix` on the script:
```shell
sudo apt update
sudo apt install dos2unix
dos2unix ./run
```
After executing the above commands, running `./run setup` should work successfully.
#### Store Project Files within the WSL File System
If you continue to experience issues, consider storing your project files within the WSL file system instead of the Windows file system. This method avoids path translations and permissions issues and provides a more consistent development environment.
You can keep running the command to get feedback on where you are up to with your setup.
When setup has been completed, the command will return an output like this:
Upon logging in, you will get a page that looks something like this: your task history down the left-hand side of the page, and the 'chat' window to send tasks to your agent.
When you have finished with your agent or just need to restart it, use Ctl-C to end the session. Then, you can re-run the start command.
If you are having issues and want to ensure the agent has been stopped, there is a `./run agent stop` command, which will kill the process using port 8000, which should be the agent.
## Benchmarking your Agent
The benchmarking system can also be accessed using the CLI too:
- [**Reporting a Vulnerability**](#reporting-a-vulnerability)
## Using AutoGPT Securely
### Restrict Workspace
Since agents can read and write files, it is important to keep them restricted to a specific workspace. This happens by default *unless* RESTRICT_TO_WORKSPACE is set to False.
Disabling RESTRICT_TO_WORKSPACE can increase security risks. However, if you still need to disable it, consider running AutoGPT inside a [sandbox](https://developers.google.com/code-sandboxing), to mitigate some of these risks.
### Untrusted inputs
When handling untrusted inputs, it's crucial to isolate the execution and carefully pre-process inputs to mitigate script injection risks.
For maximum security when handling untrusted inputs, you may need to employ the following:
* Sandboxing: Isolate the process.
* Updates: Keep your libraries (including AutoGPT) updated with the latest security patches.
* Input Sanitation: Before feeding data to the model, sanitize inputs rigorously. This involves techniques such as:
* Validation: Enforce strict rules on allowed characters and data types.
* Filtering: Remove potentially malicious scripts or code fragments.
* Encoding: Convert special characters into safe representations.
* Verification: Run tooling that identifies potential script injections (e.g. [models that detect prompt injection attempts](https://python.langchain.com/docs/guides/safety/hugging_face_prompt_injection)).
### Data privacy
To protect sensitive data from potential leaks or unauthorized access, it is crucial to sandbox the agent execution. This means running it in a secure, isolated environment, which helps mitigate many attack vectors.
### Untrusted environments or networks
Since AutoGPT performs network calls to the OpenAI API, it is important to always run it with trusted environments and networks. Running it on untrusted environments can expose your API KEY to attackers.
Additionally, running it on an untrusted network can expose your data to potential network attacks.
However, even when running on trusted networks, it is important to always encrypt sensitive data while sending it over the network.
### Multi-Tenant environments
If you intend to run multiple AutoGPT brains in parallel, it is your responsibility to ensure the models do not interact or access each other's data.
The primary areas of concern are tenant isolation, resource allocation, model sharing and hardware attacks.
- Tenant Isolation: you must make sure that the tenants run separately to prevent unwanted access to the data from other tenants. Keeping model network traffic separate is also important because you not only prevent unauthorized access to data, but also prevent malicious users or tenants sending prompts to execute under another tenant’s identity.
- Resource Allocation: a denial of service caused by one tenant can affect the overall system health. Implement safeguards like rate limits, access controls, and health monitoring.
- Data Sharing: in a multi-tenant design with data sharing, ensure tenants and users understand the security risks and sandbox agent execution to mitigate risks.
- Hardware Attacks: the hardware (GPUs or TPUs) can also be attacked. [Research](https://scholar.google.com/scholar?q=gpu+side+channel) has shown that side channel attacks on GPUs are possible, which can make data leak from other brains or processes running on the same system at the same time.
## Reporting a Vulnerability
Beware that none of the topics under [Using AutoGPT Securely](#using-AutoGPT-securely) are considered vulnerabilities on AutoGPT.
However, If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released.
Please disclose it as a private [security advisory](https://github.com/Significant-Gravitas/AutoGPT/security/advisories/new).
A team of volunteers on a reasonable-effort basis maintains this project. As such, please give us at least 90 days to work on a fix before public exposure.
This page is a list of issues you could encounter along with their fixes.
# Forge
**Poetry configuration invalid**
The poetry configuration is invalid:
- Additional properties are not allowed ('group' was unexpected)
<img width="487" alt="Screenshot 2023-09-22 at 5 42 59 PM" src="https://github.com/Significant-Gravitas/AutoGPT/assets/9652976/dd451e6b-8114-44de-9928-075f5f06d661">
**Pydantic Validation Error**
Remove your sqlite agent.db file. it's probably because some of your data is not complying with the new spec (we will create migrations soon to avoid this problem)
## TEMPERATURE - Sets temperature in OpenAI (Default: 0)
# TEMPERATURE=0
## OPENAI_API_BASE_URL - Custom url for the OpenAI API, useful for connecting to custom backends. No effect if USE_AZURE is true, leave blank to keep the default url
AutoGPT is an experimental open-source application showcasing the capabilities of modern Large Language Models. This program, driven by GPT-4, chains together LLM "thoughts", to autonomously achieve whatever goal you set. As one of the first examples of GPT-4 running fully autonomously, AutoGPT pushes the boundaries of what is possible with AI.
This experiment aims to showcase the potential of GPT-4 but comes with some limitations:
1. Not a polished application or product, just an experiment
2. May not perform well in complex, real-world business scenarios. In fact, if it actually does, please share your results!
3. Quite expensive to run, so set and monitor your API key limits with OpenAI!
## 🛡 Disclaimer
This project, AutoGPT, is an experimental application and is provided "as-is" without any warranty, express or implied. By using this software, you agree to assume all risks associated with its use, including but not limited to data loss, system failure, or any other issues that may arise.
The developers and contributors of this project do not accept any responsibility or liability for any losses, damages, or other consequences that may occur as a result of using this software. You are solely responsible for any decisions and actions taken based on the information provided by AutoGPT.
**Please note that the use of the GPT-4 language model can be expensive due to its token usage.** By utilizing this project, you acknowledge that you are responsible for monitoring and managing your own token usage and the associated costs. It is highly recommended to check your OpenAI API usage regularly and set up any necessary limits or alerts to prevent unexpected charges.
As an autonomous experiment, AutoGPT may generate content or take actions that are not in line with real-world business practices or legal requirements. It is your responsibility to ensure that any actions or decisions made based on the output of this software comply with all applicable laws, regulations, and ethical standards. The developers and contributors of this project shall not be held responsible for any consequences arising from the use of this software.
By using AutoGPT, you agree to indemnify, defend, and hold harmless the developers, contributors, and any affiliated parties from and against any and all claims, damages, losses, liabilities, costs, and expenses (including reasonable attorneys' fees) arising from your use of this software or your violation of these terms.
---
In Q2 of 2023, AutoGPT became the fastest growing open-source project in history. Now that the dust has settled, we're committed to continued sustainable development and growth of the project.
"""Generates a feedback response based on the provided thoughts dictionary.
This method takes in a dictionary of thoughts containing keys such as 'reasoning',
'plan', 'thoughts', and 'criticism'. It combines these elements into a single
feedback message and uses the create_chat_completion() function to generate a
response based on the input message.
Args:
thoughts (dict): A dictionary containing thought elements like reasoning,
plan, thoughts, and criticism.
Returns:
str: A feedback response generated using the provided thoughts dictionary.
"""
ai_role=self.config.ai_role
feedback_prompt=f"Below is a message from an AI agent with the role of {ai_role}. Please review the provided Thought, Reasoning, Plan, and Criticism. If these elements accurately contribute to the successful execution of the assumed role, respond with the letter 'Y' followed by a space, and then explain why it is effective. If the provided information is not suitable for achieving the role's objectives, please provide one or more sentences addressing the issue and suggesting a resolution."
Agent is composed of [🧩 Components](./components.md) and responsible for executing pipelines and some additional logic. The base class for all agents is `BaseAgent`, it has the necessary logic to collect components and execute protocols.
## Important methods
`BaseAgent` provides two abstract methods needed for any agent to work properly:
1.`propose_action`: This method is responsible for proposing an action based on the current state of the agent, it returns `ThoughtProcessOutput`.
2.`execute`: This method is responsible for executing the proposed action, returns `ActionResult`.
## AutoGPT Agent
`Agent` is the main agent provided by AutoGPT. It's a subclass of `BaseAgent`. It has all the [Built-in Components](./built-in-components.md). `Agent` implements the essential abstract methods from `BaseAgent`: `propose_action` and `execute`.
## Building your own Agent
The easiest way to build your own agent is to extend the `Agent` class and add additional components. By doing this you can reuse the existing components and the default logic for executing [⚙️ Protocols](./protocols.md).
```py
classMyComponent(AgentComponent):
pass
classMyAgent(Agent):
def__init__(
self,
settings:AgentSettings,
llm_provider:MultiProvider
file_storage:FileStorage,
app_config:AppConfig,
):
# Call the parent constructor to bring in the default components
For more customization, you can override the `propose_action` and `execute` or even subclass `BaseAgent` directly. This way you can have full control over the agent's components and behavior. Have a look at the [implementation of Agent](https://github.com/Significant-Gravitas/AutoGPT/tree/master/autogpt/autogpt/agents/agent.py) for more details.
### PLEASE READ THIS DISCLAIMER AND INDEMNIFICATION AGREEMENT CAREFULLY BEFORE USING THE AUTOGPT SYSTEM. BY USING THE AUTOGPT SYSTEM, YOU AGREE TO BE BOUND BY THIS AGREEMENT.
## Introduction
AutoGPT (the "System") is a project that connects a GPT-like artificial intelligence system to the internet and allows it to automate tasks. While the System is designed to be useful and efficient, there may be instances where the System could perform actions that may cause harm or have unintended consequences.
## No Liability for Actions of the System
The developers, contributors, and maintainers of the AutoGPT project (collectively, the "Project Parties") make no warranties or representations, express or implied, about the System's performance, accuracy, reliability, or safety. By using the System, you understand and agree that the Project Parties shall not be liable for any actions taken by the System or any consequences resulting from such actions.
## User Responsibility and Respondeat Superior Liability
As a user of the System, you are responsible for supervising and monitoring the actions of the System while it is operating on your
behalf. You acknowledge that using the System could expose you to potential liability including but not limited to respondeat superior and you agree to assume all risks and liabilities associated with such potential liability.
## Indemnification
By using the System, you agree to indemnify, defend, and hold harmless the Project Parties from and against any and all claims, liabilities, damages, losses, or expenses (including reasonable attorneys' fees and costs) arising out of or in connection with your use of the System, including, without limitation, any actions taken by the System on your behalf, any failure to properly supervise or monitor the System, and any resulting harm or unintended consequences.
"""# noqa: E501
returnlegal_text
defprint_motd(logger:logging.Logger):
motd,is_new_motd=get_latest_bulletin()
ifmotd:
motd=markdown_to_ansi_style(motd)
formotd_lineinmotd.split("\n"):
logger.info(
extra={
"title":"NEWS:",
"title_color":Fore.GREEN,
"preserve_color":True,
},
msg=motd_line,
)
ifis_new_motd:
input(
Fore.MAGENTA
+Style.BRIGHT
+"NEWS: Bulletin was updated! Press Enter to continue..."
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.