-
Notifications
You must be signed in to change notification settings - Fork 363
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
toolkit: add file content viewer #825
Open
danylo-boiko
wants to merge
18
commits into
cohere-ai:main
Choose a base branch
from
danylo-boiko:add-file-content-viewer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
toolkit: add file content viewer #825
danylo-boiko
wants to merge
18
commits into
cohere-ai:main
from
danylo-boiko:add-file-content-viewer
+601
−56
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
danylo-boiko
requested review from
tomtobac,
abimacarmes,
knajjars,
BeatrixCohere,
tianjing-li,
EugeneLightsOn,
malexw,
scottmx81 and
a team
as code owners
October 31, 2024 00:28
@danylo-boiko Always happy to see more contributions from you.Will review when bandwidth permits |
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.
Description
AI Description
This PR introduces a new feature for retrieving files by ID, with a focus on agent and conversation files. The changes include:
get_file
, insrc/backend/crud/file.py
, which retrieves a file by ID. The function now accepts an optionaluser_id
parameter, allowing for more flexible file retrieval.ConversationFileFull
andAgentFileFull
, insrc/backend/schemas/file.py
, to represent conversation and agent files with additional attributes likefile_content
.get_files_by_agent_id
function insrc/backend/services/file.py
to return a list of file IDs instead of files. A new function,get_file_ids_by_agent_id
, is introduced to retrieve file IDs associated with a specific agent ID.src/backend/routers/agent.py
andsrc/backend/routers/conversation.py
to handle file retrieval by ID for agents and conversations, respectively. These routes use theget_file
function from thefile_crud
module.src/interfaces/assistants_web/src/cohere-client/client.ts
file by adding new methods,getConversationFile
andgetAgentFile
, to retrieve conversation and agent files by ID.AgentFileFull
andConversationFileFull
, insrc/interfaces/assistants_web/src/cohere-client/generated/types.gen.ts
, to represent conversation and agent files with additional attributes.getAgentFileV1AgentsAgentIdFilesFileIdGet
andgetFileV1ConversationsConversationIdFilesFileIdGet
, insrc/interfaces/assistants_web/src/cohere-client/generated/services.gen.ts
, to retrieve agent and conversation files by ID.FileViewer
, insrc/interfaces/assistants_web/src/components/UI/FileViewer.tsx
, to display file content.ConversationPanel
component insrc/interfaces/assistants_web/src/components/Conversation/ConversationPanel.tsx
to handle file viewing and deletion.useFile
, insrc/interfaces/assistants_web/src/hooks/use-files.ts
, to retrieve agent and conversation files by ID.src/backend/tests/unit/routers/test_conversation.py
to ensure the proper functioning of file retrieval by ID for conversations.