Working LLM responses and Twilio status tracking

The responses aren't good, but they do exist.
This commit is contained in:
Eli Ribble 2026-01-27 14:29:55 +00:00
parent 407b478637
commit b8e7b9b7fd
No known key found for this signature in database
13 changed files with 497 additions and 287 deletions

View file

@ -18,7 +18,7 @@ func ParsePhoneNumber(input string) (*E164, error) {
return phonenumbers.Parse(input, "US")
}
func SendText(ctx context.Context, source string, destination string, message string) error {
func SendText(ctx context.Context, source string, destination string, message string) (string, error) {
client := twilio.NewRestClient()
params := &twilioApi.CreateMessageParams{}
@ -29,15 +29,14 @@ func SendText(ctx context.Context, source string, destination string, message st
resp, err := client.Api.CreateMessage(params)
if err != nil {
return fmt.Errorf("Failed to create message to %s: %w", destination, err)
} else {
if resp.Body != nil {
log.Info().Str("dest", destination).Str("body", *resp.Body).Msg("Text message response")
} else {
log.Info().Str("dest", destination).Msg("Text message response is nil")
}
return "", fmt.Errorf("Failed to create message to %s: %w", destination, err)
}
return nil
//log.Info().Str("dest", destination).Str("sid", *resp.Body).Msg("Text message response")
if resp.Sid == nil {
log.Warn().Str("src", source).Str("dst", destination).Msg("Text message sid is nil")
return "", nil
}
return *resp.Sid, nil
}
func sendSMS(destination, source, message string) error {