MCPcopy Create free account
hub / github.com/aiscriptdev/aiscript / make_response_object

Function make_response_object

aiscript-vm/src/ai/agent.rs:58–73  ·  view source on GitHub ↗
(
    state: &mut State<'gc>,
    agent: Gc<'gc, Agent<'gc>>,
    message: String,
)

Source from the content-addressed store, hash-verified

56}
57
58fn make_response_object<'gc>(
59 state: &mut State<'gc>,
60 agent: Gc<'gc, Agent<'gc>>,
61 message: String,
62) -> Value<'gc> {
63 let fields = [
64 (state.intern_static("agent"), Value::Agent(agent)),
65 (
66 state.intern_static("message"),
67 Value::String(state.intern(message.as_bytes())),
68 ),
69 ]
70 .into_iter()
71 .collect();
72 Value::Object(state.gc_ref(Object { fields }))
73}
74
75fn agent_methods<'gc>(ctx: &Context<'gc>) -> HashMap<InternedString<'gc>, Gc<'gc, Function<'gc>>> {
76 [(

Callers 1

_run_agentFunction · 0.85

Calls 6

AgentClass · 0.85
ObjectClass · 0.85
as_bytesMethod · 0.80
gc_refMethod · 0.80
intern_staticMethod · 0.45
internMethod · 0.45

Tested by

no test coverage detected