From c9ecaef287cd2a94954bf21077d70ecfa785d669 Mon Sep 17 00:00:00 2001 From: Tyler Rockwood Date: Wed, 24 Jul 2024 11:02:31 +0000 Subject: [PATCH] Fix openai embeddings processor Forgot to attach the model name. Also correct some config constants copy/pasta issues, even if the constants are the same values today. --- internal/impl/openai/embeddings_processor.go | 1 + internal/impl/openai/translation_processor.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/impl/openai/embeddings_processor.go b/internal/impl/openai/embeddings_processor.go index a55b019fa6..6feeace955 100644 --- a/internal/impl/openai/embeddings_processor.go +++ b/internal/impl/openai/embeddings_processor.go @@ -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 { diff --git a/internal/impl/openai/translation_processor.go b/internal/impl/openai/translation_processor.go index 3f4051a07e..ae5e271f9d 100644 --- a/internal/impl/openai/translation_processor.go +++ b/internal/impl/openai/translation_processor.go @@ -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(),