SHA256
wired up voice and vision, testing motion
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "r1_voice/llm.hh"
|
||||
#include "r1_voice/stt.hh"
|
||||
#include "r1_voice/tts.hh"
|
||||
#include "r1_voice/vision_context.hh"
|
||||
|
||||
namespace r1_voice {
|
||||
|
||||
@@ -12,6 +13,7 @@ struct ConversationConfig {
|
||||
SttConfig stt;
|
||||
LlmConfig llm;
|
||||
TtsConfig tts;
|
||||
VisionConfig vision;
|
||||
};
|
||||
|
||||
class Conversation {
|
||||
@@ -32,6 +34,7 @@ private:
|
||||
SpeechToText stt_;
|
||||
LLM llm_;
|
||||
TextToSpeech tts_;
|
||||
VisionContext vision_;
|
||||
};
|
||||
|
||||
} // namespace r1_voice
|
||||
|
||||
@@ -33,7 +33,8 @@ public:
|
||||
explicit LLM(LlmConfig config);
|
||||
|
||||
std::string chat(
|
||||
const std::string& user
|
||||
const std::string& user,
|
||||
const std::string& transient_context = {}
|
||||
);
|
||||
|
||||
private:
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace r1_voice {
|
||||
|
||||
struct VisionConfig {
|
||||
std::string detections_path =
|
||||
"/dev/shm/r1_detections.json";
|
||||
|
||||
// Reject YOLO output older than this.
|
||||
double max_age_seconds = 2.5;
|
||||
|
||||
double min_confidence = 0.35;
|
||||
};
|
||||
|
||||
class VisionContext {
|
||||
public:
|
||||
explicit VisionContext(
|
||||
VisionConfig config
|
||||
);
|
||||
|
||||
bool isVisionQuestion(
|
||||
const std::string& text
|
||||
) const;
|
||||
|
||||
std::string buildContext() const;
|
||||
|
||||
private:
|
||||
VisionConfig config_;
|
||||
|
||||
static std::string lowerAscii(
|
||||
std::string text
|
||||
);
|
||||
};
|
||||
|
||||
} // namespace r1_voice
|
||||
Reference in New Issue
Block a user