Skip to content

Commit d90a48a

Browse files
committed
Refactor: Rename provider list functions to List...
This commit renames the functions used to retrieve provider names from `LLMProviders`, `TTSProviders`, and `EmbeddingProviders` to `ListLLMProviders`, `ListTTSProviders`, and `ListEmbeddingProviders` respectively. This better reflects the functions' purpose and aligns with common naming conventions. The change affects the following files: - `coord.go`: Updates function names to reflect the change. - `provider/aistudio/aistudio_model.go`: Updates function call in `init`. - `provider/anthropic/anthropic_model.go`: Updates function call in `init`. - `provider/ollama/ollama_model.go`: Updates function call in `init`. - `provider/openai/openai_model.go`: Updates function call in `init`. - `provider/vertexai/vertexai_embedding.go`: Updates function call in `init`. - `provider/vertexai/vertexai_model.go`: Updates function call in `init`.
1 parent 43453d4 commit d90a48a

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

coord.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ var (
1818
embeddingProviders = make(map[string]provider.EmbeddingProvider)
1919
)
2020

21-
// LLMProviders returns the names of the registered llm providers.
22-
func LLMProviders() []string {
21+
// ListLLMProviders returns the names of the registered llm providers.
22+
func ListLLMProviders() []string {
2323
llmProvidersMu.RLock()
2424
defer llmProvidersMu.RUnlock()
2525
list := make([]string, 0, len(llmProviders))
@@ -44,8 +44,8 @@ func RemoveLLMProvider(name string) {
4444
delete(llmProviders, name)
4545
}
4646

47-
// TTSProviders returns the names of the registered tts providers.
48-
func TTSProviders() []string {
47+
// ListTTSProviders returns the names of the registered tts providers.
48+
func ListTTSProviders() []string {
4949
ttsProvidersMu.RLock()
5050
defer ttsProvidersMu.RUnlock()
5151
list := make([]string, 0, len(ttsProviders))
@@ -70,8 +70,8 @@ func RemoveTTSProvider(name string) {
7070
delete(ttsProviders, name)
7171
}
7272

73-
// EmbeddingProviders returns the names of the registered embedding providers.
74-
func EmbeddingProviders() []string {
73+
// ListEmbeddingProviders returns the names of the registered embedding providers.
74+
func ListEmbeddingProviders() []string {
7575
embeddingProvidersMu.RLock()
7676
defer embeddingProvidersMu.RUnlock()
7777
list := make([]string, 0, len(embeddingProviders))

provider/aistudio/aistudio_model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ var Provider AIStudioProvider
506506

507507
func init() {
508508
var exists bool
509-
for _, n := range coord.LLMProviders() {
509+
for _, n := range coord.ListLLMProviders() {
510510
if n == ProviderName {
511511
exists = true
512512
break

provider/anthropic/anthropic_model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ var Provider AnthropicProvider
600600

601601
func init() {
602602
var exists bool
603-
for _, n := range coord.LLMProviders() {
603+
for _, n := range coord.ListLLMProviders() {
604604
if n == ProviderName {
605605
exists = true
606606
break

provider/ollama/ollama_model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ var Provider OllamaProvider
199199

200200
func init() {
201201
var exists bool
202-
for _, n := range coord.LLMProviders() {
202+
for _, n := range coord.ListLLMProviders() {
203203
if n == ProviderName {
204204
exists = true
205205
break

provider/openai/openai_model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ var Provider OpenAIProvider
460460

461461
func init() {
462462
var exists bool
463-
for _, n := range coord.LLMProviders() {
463+
for _, n := range coord.ListLLMProviders() {
464464
if n == ProviderName {
465465
exists = true
466466
break

provider/vertexai/vertexai_embedding.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func (VertexAIProvider) NewEmbeddingClient(ctx context.Context, configs ...pconf
194194

195195
func init() {
196196
var exists bool
197-
for _, n := range coord.EmbeddingProviders() {
197+
for _, n := range coord.ListEmbeddingProviders() {
198198
if n == ProviderName {
199199
exists = true
200200
break

provider/vertexai/vertexai_model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ var Provider VertexAIProvider
539539

540540
func init() {
541541
var exists bool
542-
for _, n := range coord.LLMProviders() {
542+
for _, n := range coord.ListLLMProviders() {
543543
if n == ProviderName {
544544
exists = true
545545
break

0 commit comments

Comments
 (0)