MCPcopy Create free account
hub / github.com/ClickHouse/ai-sdk-cpp / start_trace

Method start_trace

src/langfuse/tracer.cpp:182–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182std::shared_ptr<Trace> Tracer::start_trace(const std::string& name,
183 TraceOptions opts) {
184 auto trace = std::make_shared<Trace>(*this, Trace::new_uuid(), name);
185 if (opts.input)
186 trace->set_input(std::move(*opts.input));
187 if (opts.output)
188 trace->set_output(std::move(*opts.output));
189 if (opts.user_id)
190 trace->set_user_id(std::move(*opts.user_id));
191 if (opts.session_id)
192 trace->set_session_id(std::move(*opts.session_id));
193 if (opts.metadata)
194 trace->set_metadata(std::move(*opts.metadata));
195 for (auto& t : opts.tags)
196 trace->add_tag(std::move(t));
197 return trace;
198}
199
200bool Tracer::send_batch(const JsonValue& events) {
201 if (!is_valid()) {

Callers 1

mainFunction · 0.80

Calls 6

set_inputMethod · 0.80
set_outputMethod · 0.80
set_user_idMethod · 0.80
set_session_idMethod · 0.80
set_metadataMethod · 0.80
add_tagMethod · 0.80

Tested by

no test coverage detected