Skip to content

Commit 8f578e5

Browse files
committed
remove extraneous comments
1 parent cc3ea82 commit 8f578e5

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

samples/agentic-strands/app/agent.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
)
3636

3737
def parse_assistant_response(**kwargs):
38-
# print(json.dumps(kwargs["message"], indent=2)) # Debugging line
39-
40-
# Extract the assistant's text message
38+
# Extract the assistant's text message from JSON
4139
assistant_text = kwargs["message"]["content"][0]["text"]
4240

4341
print("Assistant Text: ", assistant_text)
@@ -129,7 +127,6 @@ def search_for_books(query, filters=None) -> str:
129127

130128
print("Agent model:", agent.model.config)
131129

132-
133130
# Flask routes
134131
@app.route('/')
135132
def index():
@@ -145,24 +142,19 @@ def chat():
145142
return jsonify({"error": "No JSON data received"}), 400
146143

147144
user_message = data.get('message')
148-
149145
if not user_message:
150146
return jsonify({"error": "No message provided"}), 400
151-
152147
print(f"Received message: {user_message}")
153148

154149
agent(f"Continue the conversation with the user. The user says: {user_message}")
155150

156-
# # Return the response from latest_response
157151
response_content = latest_response.get("message", "I'm thinking about your question...")
158152

159153
return jsonify({
160154
"response": response_content
161155
})
162156

163157
except Exception as e:
164-
import traceback
165-
traceback.print_exc()
166158
print(f"Error in /chat endpoint: {str(e)}")
167159
return jsonify({"error": str(e), "response": str(e)}), 500
168160

samples/agentic-strands/app/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ <h1>Library Assistant AI</h1>
6565
<p>Chat with our AI Library Assistant to get personalized book recommendations.</p>
6666

6767
<div class="chat-container" id="chat-container">
68-
<!-- Messages will appear here -->
6968
<div class="message agent-message">
7069
Hello! I'm your library assistant. How can I help you with your reading today?
7170
</div>

0 commit comments

Comments
 (0)