MCPcopy
hub / github.com/triggerdotdev/trigger.dev / list

Method list

integrations/openai/src/assistants.ts:110–155  ·  view source on GitHub ↗
(
    key: IntegrationTaskKey,
    params: Prettify<OpenAI.Beta.AssistantListParams> | OpenAIRequestOptions = {},
    options: OpenAIRequestOptions | undefined = undefined
  )

Source from the content-addressed store, hash-verified

108 options?: OpenAIRequestOptions,
109 ): Promise<OpenAI.Beta.Assistant[]>;
110 async list(
111 key: IntegrationTaskKey,
112 params: Prettify<OpenAI.Beta.AssistantListParams> | OpenAIRequestOptions = {},
113 options: OpenAIRequestOptions | undefined = undefined
114 ): Promise<OpenAI.Beta.Assistant[]> {
115 return this.runTask(
116 key,
117 async (client, task) => {
118 if (isRequestOptions(params)) {
119 const { data, response } = await client.beta.assistants
120 .list({
121 idempotencyKey: task.idempotencyKey,
122 ...params,
123 })
124 .withResponse();
125
126 task.outputProperties = createTaskOutputProperties(undefined, response.headers);
127
128 return data.data;
129 }
130
131 const { data, response } = await client.beta.assistants
132 .list(params, {
133 idempotencyKey: task.idempotencyKey,
134 ...options,
135 })
136 .withResponse();
137
138 task.outputProperties = createTaskOutputProperties(undefined, response.headers);
139
140 return data.data;
141
142 },
143 {
144 name: "List Assistants",
145 params,
146 properties: !isRequestOptions(params) ? [
147 ...(params.before ? [{ label: "before", text: params.before }] : []),
148 ...(params.order ? [{ label: "order", text: params.order }] : []),
149 ...(params.after ? [{ label: "after", text: params.after }] : []),
150 ...(params.limit ? [{ label: "limit", text: String(params.limit) }] : []),
151 ] : [],
152 },
153 handleOpenAIError
154 );
155 }
156
157 async del(
158 key: IntegrationTaskKey,

Callers

nothing calls this directly

Calls 4

isRequestOptionsFunction · 0.90
withResponseMethod · 0.80
runTaskMethod · 0.45

Tested by

no test coverage detected