Verified Owner
Top Description Methods
org.jabref.logic.ai.models

public Interface AiModelProvider

Known Direct Implementers
org.jabref.logic.ai.models.OpenAiCompatibleModelProvider
Annotations
@NullMarked
Imports
java.util.List, org.jabref.model.ai.llm.AiProvider, org.jspecify.annotations.NullMarked, .Nullable

Interface for fetching available AI models from different providers. Implementations should handle API calls to retrieve model lists dynamically.

Method Summary

Modifier and TypeMethod and Description
public List<String>

Returns:

A list of available model names (never null, empty if fetch fails)
fetchModels
(AiProvider
The AI provider to fetch models from
aiProvider
,
String
The base URL for the API
apiBaseUrl
,
@Nullable String
The API key for authentication (may be null for providers that don't require it)
apiKey
)

Fetches the list of available models for the given AI provider.

public boolean

Returns:

true if this provider can fetch models for the given AI provider
supports
(AiProvider
The AI provider to check
aiProvider
)

Checks if this provider supports the given AI provider type.

Method Detail

fetchModelsback to summary
public List<String> fetchModels(AiProvider aiProvider, String apiBaseUrl, @Nullable String apiKey)

Fetches the list of available models for the given AI provider.

Parameters
aiProvider:AiProvider

The AI provider to fetch models from

apiBaseUrl:String

The base URL for the API

apiKey:@Nullable String

The API key for authentication (may be null for providers that don't require it)

Returns:List<String>

A list of available model names (never null, empty if fetch fails)

supportsback to summary
public boolean supports(AiProvider aiProvider)

Checks if this provider supports the given AI provider type.

Parameters
aiProvider:AiProvider

The AI provider to check

Returns:boolean

true if this provider can fetch models for the given AI provider