Skip to content

feat: dynamically fetch and embed AI models list#43

Open
abhinavgautam01 wants to merge 1 commit into
chaoss:mainfrom
abhinavgautam01:issue-42-model-list
Open

feat: dynamically fetch and embed AI models list#43
abhinavgautam01 wants to merge 1 commit into
chaoss:mainfrom
abhinavgautam01:issue-42-model-list

Conversation

@abhinavgautam01

Copy link
Copy Markdown
Contributor

fixes #42....

Description

This PR addresses the need to detect a wide variety of AI models (like the extensive lists available in Cursor) without requiring a manual patchwork PR for every new model combination released...

It introduces a go generate script that fetches a comprehensive list of models dynamically from the OpenRouter API. The script cleans the data, filters out noise, and generates a native models.go file containing all recognized AI models to be used by the tool mention detector..

Changes Made

  • Added detection/toolmention/generate.go to fetch the OpenRouter models API and generate a sorted Go array of model names.
  • Added a //go:generate go run generate.go directive in detection/toolmention/toolmention.go.
  • Updated the init() function to append the dynamically generated models to the base tools array prior to regex compilation.

Testing

  • Ran go generate ./... locally which successfully created models.go populated with hundreds of current models.
  • Verified that all unit tests in go test ./... pass successfully.

Signed-off-by: abhinavgautam01 <abgautam1017@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

find a model name/version list from somewhere

1 participant