steps.mjs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
  2. import { APIResource } from "../../../../core/resource.mjs";
  3. import { CursorPage } from "../../../../core/pagination.mjs";
  4. import { buildHeaders } from "../../../../internal/headers.mjs";
  5. import { path } from "../../../../internal/utils/path.mjs";
  6. /**
  7. * @deprecated The Assistants API is deprecated in favor of the Responses API
  8. */
  9. export class Steps extends APIResource {
  10. /**
  11. * Retrieves a run step.
  12. *
  13. * @deprecated The Assistants API is deprecated in favor of the Responses API
  14. */
  15. retrieve(stepID, params, options) {
  16. const { thread_id, run_id, ...query } = params;
  17. return this._client.get(path `/threads/${thread_id}/runs/${run_id}/steps/${stepID}`, {
  18. query,
  19. ...options,
  20. headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
  21. });
  22. }
  23. /**
  24. * Returns a list of run steps belonging to a run.
  25. *
  26. * @deprecated The Assistants API is deprecated in favor of the Responses API
  27. */
  28. list(runID, params, options) {
  29. const { thread_id, ...query } = params;
  30. return this._client.getAPIList(path `/threads/${thread_id}/runs/${runID}/steps`, (CursorPage), {
  31. query,
  32. ...options,
  33. headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
  34. });
  35. }
  36. }
  37. //# sourceMappingURL=steps.mjs.map