Skip to content

Commit

Permalink
Merge pull request redpanda-data#2732 from rockwotj/openai-fixes
Browse files Browse the repository at this point in the history
Fix openai embeddings processor
  • Loading branch information
mihaitodor authored Jul 24, 2024
2 parents 4e3b047 + c9ecaef commit d51b395
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 d51b395

Please sign in to comment.