MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / request

Method request

integrations/replicate/src/index.ts:153–177  ·  view source on GitHub ↗

Make a request to the Replicate API.

(
    key: IntegrationTaskKey,
    params: {
      route: string | URL;
      options: Parameters<ReplicateClient["request"]>[1];
    }
  )

Source from the content-addressed store, hash-verified

151
152 /** Make a request to the Replicate API. */
153 request<T = any>(
154 key: IntegrationTaskKey,
155 params: {
156 route: string | URL;
157 options: Parameters<ReplicateClient["request"]>[1];
158 }
159 ): ReplicateReturnType<T> {
160 return this.runTask(
161 key,
162 async (client) => {
163 const response = await client.request(params.route, params.options);
164
165 return response.json();
166 },
167 {
168 name: "Send Request",
169 params,
170 properties: [
171 { label: "Route", text: params.route.toString() },
172 ...(params.options.method ? [{ label: "Method", text: params.options.method }] : []),
173 ],
174 callback: { enabled: true },
175 }
176 );
177 }
178
179 /** Run a model and await the result. */
180 run(

Callers 3

nextPageMethod · 0.95
trigger.test.tsFile · 0.80
index.test.tsFile · 0.80

Calls 3

runTaskMethod · 0.95
jsonMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected