Skip to content

Commit

Permalink
Rework lex timeouts and prompting
Browse files Browse the repository at this point in the history
  • Loading branch information
docwho2 committed Nov 29, 2023
1 parent 4fed67d commit 3cb4e07
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class ChatGPTLambda implements RequestHandler<LexV2Event, LexV2Response>

final static DynamoDbTable<ChatGPTSessionState> sessionState = enhancedClient.table(System.getenv("SESSION_TABLE_NAME"), schema);

final static OpenAiService open_ai_service = new OpenAiService(System.getenv("OPENAI_API_KEY"), Duration.ofSeconds(25));
final static OpenAiService open_ai_service = new OpenAiService(System.getenv("OPENAI_API_KEY"), Duration.ofSeconds(50));
final static String OPENAI_MODEL = System.getenv("OPENAI_MODEL");


Expand Down
30 changes: 23 additions & 7 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -335,18 +335,33 @@ Resources:
ParentIntentSignature: "AMAZON.FallbackIntent"
FulfillmentCodeHook:
Enabled: true
InitialResponseSetting:
InitialResponse:
FulfillmentUpdatesSpecification:
Active: true
TimeoutInSeconds: 65
StartResponse:
AllowInterrupt: false
MessageGroupsList:
- Message:
PlainTextMessage:
Value: Thinking
Variations:
DelayInSeconds: 1
MessageGroups:
- Message:
PlainTextMessage:
Value: Thinking
Variations:
- PlainTextMessage:
Value: Working
- PlainTextMessage:
Value: Processing
UpdateResponse:
AllowInterrupt: false
FrequencyInSeconds: 15
MessageGroups:
- Message:
PlainTextMessage:
Value: Still Thinking
Variations:
- PlainTextMessage:
Value: Still Working
- PlainTextMessage:
Value: Still Processing
- LocaleId: es_US
Description: ChatGPT Bot Spanish
NluConfidenceThreshold: 0.40
Expand Down Expand Up @@ -446,6 +461,7 @@ Resources:
Handler: cloud.cleo.squareup.ChatGPTLambda
AutoPublishAlias: SNAPSTART
CodeUri: ./ChatGPT
Timeout: 60
Environment:
Variables:
OPENAI_MODEL: !Ref OPENAIMODEL
Expand Down

0 comments on commit 3cb4e07

Please sign in to comment.