Skip to content

Commit

Permalink
fix: handle longer phrases
Browse files Browse the repository at this point in the history
  • Loading branch information
jackmcguire1 committed May 16, 2024
1 parent b409de3 commit f4dea22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ func (h *Handler) DispatchIntents(ctx context.Context, req alexa.Request) (res a
spaces := strings.Split(prompt, " ")
sourceLanguage := spaces[0]
targetLanguage := spaces[2]
promptToTranslate := strings.Split(prompt, targetLanguage)[1]
promptPhrase := strings.Split(prompt, targetLanguage)
promptToTranslate := strings.Join(promptPhrase[1:len(promptPhrase)-1], " ")

err = h.RequestsQueue.PushMessage(ctx, &chatmodels.Request{
Prompt: promptToTranslate,
Expand Down

0 comments on commit f4dea22

Please sign in to comment.