FormulaMonks / kurt

A wrapper for AI SDKs, for building LLM-agnostic structured AI applications in Typescript
MIT License
2 stars 0 forks source link

feat: add static functions on the adapters to check for compatible model names #19

Closed jemc closed 1 month ago

jemc commented 1 month ago

Both KurtOpenAI and KurtVertexAI support multiple different models, selectable by name. This change adds an isSupportedModel function to both, so that users of the libraries can easily check if a given string matches a supported model name.

This function also acts as a type guard that can be used from TypeScript to convert a string conditionally into a strongly typed type union of model ames.

Also, the exports for these packages have been expanded to include additional types like the aforementioned type union of model names.

These new features make it easier to build applications that have some functions dealing with model name strings in deciding which Kurt adapter to create, helping with Kurt's central mission to make it easy to build applications which switch between different LLMs.

github-actions[bot] commented 1 month ago

:tada: This PR is included in version @formula-monks/kurt-open-ai-v1.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 1 month ago

:tada: This PR is included in version @formula-monks/kurt-vertex-ai-v1.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: