Skip to content

Commit 65d48b5

Browse files
authored
Fix agent enums (#940)
Fix (not-released) unintentionally broken agent enums in #909
1 parent b0081d4 commit 65d48b5

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

lib/src/agent/agent.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class Agent extends ChangeNotifier {
6161
return false;
6262
}
6363
return switch (_agentState) {
64-
AgentState.LISTENING || AgentState.THINKING || AgentState.SPEAKING => true,
64+
AgentState.listening || AgentState.thinking || AgentState.speaking => true,
6565
_ => false,
6666
};
6767
}
@@ -76,7 +76,7 @@ class Agent extends ChangeNotifier {
7676
}
7777
if (_state == _AgentLifecycle.connected) {
7878
return switch (_agentState) {
79-
AgentState.LISTENING || AgentState.THINKING || AgentState.SPEAKING => true,
79+
AgentState.listening || AgentState.thinking || AgentState.speaking => true,
8080
_ => false,
8181
};
8282
}
@@ -90,7 +90,7 @@ class Agent extends ChangeNotifier {
9090
}
9191
if (_state == _AgentLifecycle.connected) {
9292
return switch (_agentState) {
93-
AgentState.IDLE || AgentState.INITIALIZING => true,
93+
AgentState.idle || AgentState.initializing => true,
9494
_ => false,
9595
};
9696
}
@@ -169,15 +169,15 @@ class Agent extends ChangeNotifier {
169169
}
170170
switch (rawState) {
171171
case 'idle':
172-
return AgentState.IDLE;
172+
return AgentState.idle;
173173
case 'initializing':
174-
return AgentState.INITIALIZING;
174+
return AgentState.initializing;
175175
case 'listening':
176-
return AgentState.LISTENING;
176+
return AgentState.listening;
177177
case 'speaking':
178-
return AgentState.SPEAKING;
178+
return AgentState.speaking;
179179
case 'thinking':
180-
return AgentState.THINKING;
180+
return AgentState.thinking;
181181
default:
182182
return null;
183183
}

lib/src/json/agent_attributes.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,33 +45,33 @@ class AgentAttributes {
4545
@JsonEnum(alwaysCreate: true)
4646
enum AgentInput {
4747
@JsonValue('audio')
48-
AUDIO,
48+
audio,
4949
@JsonValue('text')
50-
TEXT,
50+
text,
5151
@JsonValue('video')
52-
VIDEO,
52+
video,
5353
}
5454

5555
@JsonEnum(alwaysCreate: true)
5656
enum AgentOutput {
5757
@JsonValue('audio')
58-
AUDIO,
58+
audio,
5959
@JsonValue('transcription')
60-
TRANSCRIPTION,
60+
transcription,
6161
}
6262

6363
@JsonEnum(alwaysCreate: true)
6464
enum AgentState {
6565
@JsonValue('idle')
66-
IDLE,
66+
idle,
6767
@JsonValue('initializing')
68-
INITIALIZING,
68+
initializing,
6969
@JsonValue('listening')
70-
LISTENING,
70+
listening,
7171
@JsonValue('speaking')
72-
SPEAKING,
72+
speaking,
7373
@JsonValue('thinking')
74-
THINKING,
74+
thinking,
7575
}
7676

7777
@JsonSerializable()

lib/src/json/agent_attributes.g.dart

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)