Skip to content

Commit

Permalink
Fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter committed Apr 17, 2024
1 parent 8fb087d commit 42ac1bd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/examples/amazon-dynamodb-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ In this example, we will show you how to use the [AmazonDynamoDbConversationMemo
This code implements the idea of a generic "Session" that represents a Conversation Memory entry. For example, a "Session" could be used to represent an individual user's conversation, or a group conversation thread.

```python
import sys
import os
import argparse

Expand All @@ -17,13 +18,12 @@ from griptape.drivers import (
from griptape.structures import Agent
from griptape.memory.structure import ConversationMemory

parser = argparse.ArgumentParser()
parser.add_argument("input", type=str, help="The input to be passed to the Structure.")
parser.add_argument("session_id", type=str, nargs="?", default="default-session-id", help="The session identifier.")
args = parser.parse_args()

input = args.input
session_id = args.session_id
if len(sys.argv) > 2:
input = sys.argv[1]
session_id = sys.argv[2]
else:
input = "Hello!" # Default input
session_id = "session-id-123" # Default session ID

structure = Agent(
conversation_memory=ConversationMemory(
Expand Down

0 comments on commit 42ac1bd

Please sign in to comment.