Skip to content

Conversation

@wangzuo
Copy link
Contributor

@wangzuo wangzuo commented Apr 1, 2025

No description provided.

@wangzuo wangzuo requested a review from Copilot April 1, 2025 02:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new async "models" method to the OpenAI, Ollama, and Anthropic providers, along with example scripts demonstrating how to list available models.

  • Added a "models" method in each provider that makes a GET request to fetch and return JSON data.
  • Introduced example files for each provider to demonstrate listing models using the new API.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/providers/openai.ts Added async models method that builds a request with dynamic baseURL and API key.
src/providers/ollama.ts Added async models method fetching data from a localhost endpoint.
src/providers/anthropic.ts Added async models method with required headers including API key and version data.
examples/openai-list-models.ts Example usage of the new models method for OpenAI.
examples/ollama-list-models.ts Example usage of the new models method for Ollama.
examples/anthropic-list-models.ts Example usage of the new models method for Anthropic.

@modalityml modalityml deleted a comment from Copilot AI Apr 1, 2025
@modalityml modalityml deleted a comment from Copilot AI Apr 1, 2025
@modalityml modalityml deleted a comment from Copilot AI Apr 1, 2025
@wangzuo wangzuo closed this Apr 2, 2025
@wangzuo wangzuo deleted the list-models branch April 2, 2025 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants