载入中...
搜索中...
未找到
RenderVision.hpp
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4
5#include <atomic>
6#include <mutex>
7#include <string>
8
9namespace eve {
10class IRenderCapture;
11}
12
13namespace eve::dev {
14
37public:
38 static RenderVision& instance();
39
40 RenderVision(const RenderVision&) = delete;
42
43 // --- Config (env-backed on first use) ---
44 void setBaseUrl(std::string url);
45 void setApiKey(std::string key);
46 void setModel(std::string model);
47 void setPath(std::string path);
48 void setTimeoutMs(int ms);
50 std::string configJson();
51 bool configured();
52
53 // --- Cache ---
54 std::string latest() const;
55 std::string lastError() const;
56
57 // --- Pending trigger (recorded off-main; dumped on main thread) ---
59 void notifyPending(const std::string& reason, const std::string& source, int line);
60 bool pending() const;
61 std::string pendingReason() const;
62
68 std::string describe(eve::IRenderCapture* cap, const std::string& renderDataJson, bool fresh,
69 const std::string& reason = {});
70
72 void pollPending(eve::IRenderCapture* cap, const std::string& renderDataJson);
73
74private:
75 // Immortal<RenderVision> constructs the singleton (devtools/Immortal.hpp).
76 template <typename> friend struct Immortal;
77 RenderVision() = default;
78
79 void ensureEnvLocked();
80 std::string doDescribe(eve::IRenderCapture* cap, const std::string& renderDataJson, const std::string& reason);
81
82 mutable std::mutex mu_;
83 std::string baseUrl_ = "http://127.0.0.1:11434/v1";
84 std::string apiKey_;
85 std::string model_ = "llava";
86 std::string path_ = "/chat/completions";
87 int timeoutMs_ = 20000;
88 bool envLoaded_ = false;
89
90 std::string latest_;
91 std::string lastError_;
92
93 std::atomic<bool> pending_{false};
94 std::string pendingReason_;
95 std::string pendingLoc_;
96};
97
98} // namespace eve::dev
int line
#define EVENGINE_API
宿主(eve / libmain)导出宏;插件从进程导入同一批符号。
Definition Export.h:16
glm::mat4 model
Frame capture + camera + visible-entity inspection (graphics).
Vision-model bridge for rendered-frame review (desktop / devtools only).
RenderVision(const RenderVision &)=delete
RenderVision & operator=(const RenderVision &)=delete
Definition Build.cpp:11
Process-immortal singleton holder for DevTools objects.
Definition Immortal.hpp:19