-
Notifications
You must be signed in to change notification settings - Fork 415
[backend/db] setting up agents in db #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #175 +/- ##
=======================================
Coverage ? 88.38%
=======================================
Files ? 121
Lines ? 3839
Branches ? 0
=======================================
Hits ? 3393
Misses ? 446
Partials ? 0 ☔ View full report in Codecov by Sentry. |
lusmoura
approved these changes
Jun 6, 2024
tianjing-li
reviewed
Jun 6, 2024
tianjing-li
reviewed
Jun 6, 2024
lusmoura
approved these changes
Jun 6, 2024
tianjing-li
approved these changes
Jun 6, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you for contributing to the Cohere Toolkit!
This is the first PR in a series where we introduce agents to toolkit!
This PR adds DB changes to accomodate agents in the API. This PR is purely focused on DB migration, CRUD operations on the new DB table, and tests.
Follow ups:
Migration to have relationship between tools/agents and deployments/agents
The API route logic for agents
Add tests and docs: Please include testing and documentation for your changes
Lint and test: Run
make lint
andmake run-tests
AI Description
This PR introduces a new
Agent
model and its associated CRUD operations.The
Agent
model represents a new entity with the following attributes:version
: An integer representing the version of the agent.name
: A string containing the name of the agent.description
: A string providing a description of the agent.preamble
: A string containing additional information about the agent.temperature
: A float value associated with the agent.model
: A string indicating the model type of the agent, with possible values including "COMMAND_R", "COMMAND_R_PLUS", "COMMAND_LIGHT", and "COMMAND".deployment
: A string specifying the deployment type of the agent, with possible values such as "COHERE_PLATFORM", "SAGE_MAKER", "AZURE", and "BEDROCK".user_id
: A string representing the ID of the user associated with the agent.id
: A unique identifier for the agent.created_at
andupdated_at
: Datetime values indicating when the agent was created and last updated.The following changes have been made:
Agent
class insrc/backend/database_models/agent.py
to define the structure of theAgent
model, including its attributes and their data types.Agent
model insrc/backend/crud/agent.py
:create_agent
: Creates a new agent and returns it.get_agent
: Retrieves an agent by its ID.get_agents
: Fetches all agents for a user, with optional pagination usingoffset
andlimit
.update_agent
: Updates an existing agent with new data.delete_agent
: Deletes an agent by its ID.src/backend/tests/crud/test_agent.py
to ensure their functionality and integrity constraints.Agent
model and its operations.