Skip to content

Commit

Permalink
Fix openai embeddings processor
Browse files Browse the repository at this point in the history
Forgot to attach the model name.

Also correct some config constants copy/pasta issues, even if the
constants are the same values today.
  • Loading branch information
rockwotj committed Jul 24, 2024
1 parent 4e3b047 commit c9ecaef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions internal/impl/openai/embeddings_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ type embeddingsProcessor struct {

func (p *embeddingsProcessor) Process(ctx context.Context, msg *service.Message) (service.MessageBatch, error) {
var body oai.EmbeddingsOptions
body.DeploymentName = &p.model
if p.text != nil {
s, err := msg.BloblangQueryValue(p.text)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/impl/openai/translation_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ To learn more about translation, see the https://platform.openai.com/docs/guides
)...,
).
Fields(
service.NewBloblangField(otspFieldFile).
service.NewBloblangField(otlpFieldFile).
Description("The audio file object (not file name) to translate, in one of the following formats: `flac`, `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `ogg`, `wav`, or `webm`.").
Optional(),
service.NewInterpolatedStringField(otspFieldPrompt).
service.NewInterpolatedStringField(otlpFieldPrompt).
Description("Optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.").
Optional().
Advanced(),
Expand Down

0 comments on commit c9ecaef

Please sign in to comment.