https://github.com/JeffreyRichter/Tool-Selection.git
This project uses Azure OpenAI embeddings to find the most relevant tools for given prompts.
The application:
list-tools.jsonprompts.jsonmain.go - Main application logic and embedding generationprompts.go - JSON loading functionality for test promptsprompts.json - Test prompts organized by expected tool (easily editable)list-tools.json - Tool definitions and schemasvectordb.go - Vector database implementationmcp/messages.go - MCP protocol message structuresThis application requires two environment variables to be configured:
TEXT_EMBEDDING_API_KEY - Your Azure OpenAI API keyAOAI_ENDPOINT - Your Azure OpenAI endpoint URL (including deployment and API version)export TEXT_EMBEDDING_API_KEY="your_api_key_here"
export AOAI_ENDPOINT="https://your-resource.openai.azure.com/openai/deployments/text-embedding-3-large/embeddings?api-version=2023-05-15"
cp .env.example .env
.env and add both required variables:TEXT_EMBEDDING_API_KEY=your_actual_api_key_here
AOAI_ENDPOINT=https://your-resource.openai.azure.com/openai/deployments/text-embedding-3-large/embeddings?api-version=2023-05-15
api-key.txt in the project root with your API key.
Note: This option only provides the API key. You must still set the AOAI_ENDPOINT environment variable when using this method.
Note: The .env file and api-key.txt are both included in .gitignore to prevent accidentally committing sensitive information.
go run .
The application supports different output formats based on your needs:
.txt files:
go run .
# or
go run . > results.txt
output environment variable to md:
output=md go run . > analysis_results.md
Plain Text (.txt or terminal):
MARKDOWN_OUTPUT.md for detailed examples and features.
{
"tool-name": [
"Test prompt 1",
"Test prompt 2"
]
}
This file can be easily edited to:
.env files for local development (they're gitignored)