Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
Fix: Make top-level tool a context
Browse files Browse the repository at this point in the history
We need to make this tool a context so that when it is added to a
script, the script knows to use it. This also allows us to add
context/workspace as a shared context tool, which is need for this tool
to function properly.
  • Loading branch information
cjellick committed Aug 12, 2024
1 parent 50d2e44 commit e72c53d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tool.gpt
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
Name: Knowledge
Description: Create a knowledge base from files in the workspace directory and retrieve information from it.
Type: context
Share Tools: local-knowledge-retriever
Share Context: github.com/gptscript-ai/context/workspace

#!sys.echo

You have access to an ad-hoc RAG tool named local-knowledge-retriever. It will ingest files in the workspace on-the-fly and query them. Use it to answer questions from the user. If the answers it returns seem irrelevant, you can use other tools. When you give answers, always give a proper citation to the best of your abilities. ALWAYS prefer this tool over the read tool.

---
Name: local-knowledge-retriever
Description: Create a knowledge base from files in the workspace directory and retrieve information from it.
Context: github.com/gptscript-ai/context/workspace
Credential: github.com/gptscript-ai/credential as sys.openai with OPENAI_API_KEY as env and "Please provide your OpenAI API key" as message and key as field
Args: query: The query to search for in the knowledge directory.

#!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool askdir --path ${GPTSCRIPT_WORKSPACE_DIR} "${QUERY}"
#!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool askdir --path "${GPTSCRIPT_WORKSPACE_DIR}" "${QUERY}"

---
name: retrieval
Expand Down

0 comments on commit e72c53d

Please sign in to comment.