Skip to content

Instantly share code, notes, and snippets.

@rjpower
Created February 26, 2025 05:05
Show Gist options
  • Save rjpower/3c2ff725f7e5abf8caf7ac2f629e9226 to your computer and use it in GitHub Desktop.
Save rjpower/3c2ff725f7e5abf8caf7ac2f629e9226 to your computer and use it in GitHub Desktop.
-}
-
-export function useStartRecording() {
- const recorder = useAtomValue(recorderAtom);
- const setIsRecording = useSetAtom(isRecordingAtom);
- const setError = useSetAtom(errorAtom);
- const setChatHistory = useSetAtom(chatHistoryAtom);
-
- return async () => {
- try {
- if (recorder) {
- await recorder.startRecording();
- setIsRecording(true);
- setError({ type: null, message: null });
+ setWsState(WebSocketState.CONNECTED);
+ setPracticeState(PracticeState.ACTIVE);
setChatHistory((prev) => [
...prev,
{
setChatHistory((prev) => [
...prev,
{
- type: "audio",
- role: "user",
- audio: "",
- mime_type: "audio/pcm",
- end_of_turn: false,
+ type: "initialize",
+ role: "system",
+ text: translation,
+ end_of_turn: true,
},
]);
- }
- } catch (err) {
- setError({
- type: "recording",
- message: "Failed to access microphone. Please check your permissions.",
- });
- console.error("Failed to start recording:", err);
- }
- };
-}
-}
-
-export function useSendMessage() {
- const connection = useAtomValue(connectionAtom);
- const setChatHistory = useSetAtom(chatHistoryAtom);
-
+ setIsRec�# Ericsson/codechecker
+# -------------------------------------------------------------------------
+#
+# Part of the CodeChecker project, under the Apache License v2.0 with
+# LLVM Exceptions. See LICENSE for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+# -------------------------------------------------------------------------
+"""
+Defines the CodeChecker action for parsing a set of analysis results into a
+human-readable format.
+"""
+
- },
- ]);
-
+ setIsRec�# Ericsson/codechecker
+# -------------------------------------------------------------------------
+#
+# Part of the CodeChecker project, under the Apache License v2.0 with
+# LLVM Exceptions. See LICENSE for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+# -------------------------------------------------------------------------
+"""
+Defines the CodeChecker action for parsing a set of analysis results into a
+human-readable format.
+"""
+
+
+import argparse
+import os
+import sys
+"""
+Defines the CodeChecker action for parsing a set of analysis results into a
+human-readable format.
+"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment