MCPcopy Index your code
hub / github.com/github/copilot-sdk / send

Method send

nodejs/src/session.ts:237–252  ·  view source on GitHub ↗
(optionsOrPrompt: MessageOptions | string)

Source from the content-addressed store, hash-verified

235 async send(prompt: string): Promise<string>;
236 async send(options: MessageOptions): Promise<string>;
237 async send(optionsOrPrompt: MessageOptions | string): Promise<string> {
238 const options: MessageOptions =
239 typeof optionsOrPrompt === "string" ? { prompt: optionsOrPrompt } : optionsOrPrompt;
240 const response = await this.connection.sendRequest("session.send", {
241 ...(await getTraceContext(this.traceContextProvider)),
242 sessionId: this.sessionId,
243 prompt: options.prompt,
244 displayPrompt: options.displayPrompt,
245 attachments: options.attachments,
246 mode: options.mode,
247 agentMode: options.agentMode,
248 requestHeaders: options.requestHeaders,
249 });
250
251 return (response as { messageId: string }).messageId;
252 }
253
254 /**
255 * Sends a message to this session and waits until the session becomes idle.

Calls 2

getTraceContextFunction · 0.90
sendRequestMethod · 0.45

Tested by 1

startFakeUpstreamFunction · 0.36