Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Azure embeddings model detection by passing string to fullURL #637

Merged
merged 1 commit into from
Jan 16, 2024
Merged

Fix Azure embeddings model detection by passing string to fullURL #637

merged 1 commit into from
Jan 16, 2024

Conversation

greysteil
Copy link
Contributor

A recent pull request broke support for the Azure OpenAI embeddings endpoint by passing a variable of type EmbeddingModel to client.fullURL. This breaks the Azure deployment name lookup.

This pull request fixes Azure embeddings support by casting the type to string.

Tests
Added tests for generating Azure embeddings

Note: I'm not a great Go programmer. If there's a better way to do this I'm all ears!

Copy link

codecov bot commented Jan 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (09f6920) 98.43% compared to head (c72f9ec) 98.43%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #637   +/-   ##
=======================================
  Coverage   98.43%   98.43%           
=======================================
  Files          24       24           
  Lines        1342     1342           
=======================================
  Hits         1321     1321           
  Misses         15       15           
  Partials        6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sashabaranov
Copy link
Owner

sashabaranov commented Jan 16, 2024

@greysteil great catch, thank you!

For context: here's the exact part which breaks https://github.com/sashabaranov/go-openai/blob/master/client.go#L224

And a minimal code example to reproduce: https://go.dev/play/p/KakKIBplunp

There's an open issue to get rid of args ...any there and make this part type-safe #636

@sashabaranov sashabaranov merged commit 4ce03a9 into sashabaranov:master Jan 16, 2024
3 checks passed
@greysteil greysteil deleted the azure-embeddings branch January 16, 2024 13:37
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