SreekarB commited on
Commit
bf5af57
·
verified ·
1 Parent(s): e2cd21d

Upload 10 files

Browse files
Files changed (2) hide show
  1. README.md +2 -7
  2. app.py +10 -2
README.md CHANGED
@@ -1,13 +1,8 @@
1
  ---
2
- title: App Trial Current
3
- emoji: 📈
4
- colorFrom: purple
5
- colorTo: purple
6
  sdk: gradio
7
  sdk_version: 5.29.1
8
- app_file: app.py
9
- pinned: false
10
- license: mit
11
  ---
12
  # Nova Conversation Partner
13
 
 
1
  ---
2
+ title: app_trial
3
+ app_file: app.py
 
 
4
  sdk: gradio
5
  sdk_version: 5.29.1
 
 
 
6
  ---
7
  # Nova Conversation Partner
8
 
app.py CHANGED
@@ -26,6 +26,7 @@ class NovaConversationApp:
26
 
27
  def start(self):
28
  """Start the conversation with Nova"""
 
29
  self.is_running = True
30
 
31
  # Initialize the bidirectional stream
@@ -52,8 +53,11 @@ class NovaConversationApp:
52
 
53
  def conversation_loop(self):
54
  """The main conversation loop for CLI usage"""
55
- self.start()
56
-
 
 
 
57
  try:
58
  while self.is_running:
59
  print("\nListening... (Press Ctrl+C to exit)")
@@ -92,6 +96,8 @@ class NovaConversationApp:
92
  response_audio = nova_response["audio"]
93
  response_text = nova_response["transcript"]
94
 
 
 
95
  # Store the interaction in session
96
  self.session_manager.add_interaction("User speech", response_text)
97
 
@@ -106,6 +112,8 @@ class NovaConversationApp:
106
  target=self.language_coach.analyze,
107
  args=("User speech", self.session_id)
108
  ).start()
 
 
109
 
110
  self.is_processing = False
111
 
 
26
 
27
  def start(self):
28
  """Start the conversation with Nova"""
29
+ print("Starting conversation with Nova...")
30
  self.is_running = True
31
 
32
  # Initialize the bidirectional stream
 
53
 
54
  def conversation_loop(self):
55
  """The main conversation loop for CLI usage"""
56
+ # First, initialize the stream
57
+ if not self.start():
58
+ print("Error: Failed to initialize Nova stream")
59
+ return
60
+
61
  try:
62
  while self.is_running:
63
  print("\nListening... (Press Ctrl+C to exit)")
 
96
  response_audio = nova_response["audio"]
97
  response_text = nova_response["transcript"]
98
 
99
+ print(f"Nova: {response_text}")
100
+
101
  # Store the interaction in session
102
  self.session_manager.add_interaction("User speech", response_text)
103
 
 
112
  target=self.language_coach.analyze,
113
  args=("User speech", self.session_id)
114
  ).start()
115
+ else:
116
+ print("Error: No response from Nova")
117
 
118
  self.is_processing = False
119