Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: General File Reader Tool #398

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ tools:
sendgrid:
reference: ./sendgrid
all: true
file-reader:
reference: ./knowledge/file-reader.gpt
file-summarizer:
reference: ./file-summarizer
all: true
Expand Down
14 changes: 14 additions & 0 deletions knowledge/file-reader.gpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Name: File Reader
Description: This tool reads any supported type of non-text file in the workspace, converts its content to markdown format, and saves it as an output file within the workspace.
Params: Input: The workspace file to be read. This file can be of any supported non-text type.
Params: Output: The workspace file where the converted markdown content will be saved. The file should have a ".md" extension.
Params: know_load_metadata: Comma-delimited key=value pairs to be added to the metadata of the loaded document.
Credential: github.com/gptscript-ai/credentials/model-provider
Credential: ../existing-credential as knowledge
Metadata: noUserAuth: sys.model.provider.credential,knowledge

#!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool load --format=markdown --flows-file=blueprint:obot --flow=obotload "ws://files/${INPUT}" "ws://files/${OUTPUT}"

---
!metadata:*:icon
https://cdn.jsdelivr.net/npm/@phosphor-icons/core@2/assets/duotone/file-text-duotone.svg