@sanity/client 7.2.0 → 7.2.1-agent-actions.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -888,6 +888,14 @@ function _generate(client, httpRequest, request) {
888
888
  body: request
889
889
  });
890
890
  }
891
+ function _prompt(client, httpRequest, request) {
892
+ const dataset = config.hasDataset(client.config());
893
+ return _request(client, httpRequest, {
894
+ method: "POST",
895
+ uri: `/agent/action/prompt/${dataset}`,
896
+ body: request
897
+ });
898
+ }
891
899
  function _transform(client, httpRequest, request) {
892
900
  const dataset = config.hasDataset(client.config());
893
901
  return _request(client, httpRequest, {
@@ -959,6 +967,13 @@ class AgentActionsClient {
959
967
  translate(request) {
960
968
  return rxjs.lastValueFrom(_translate(this.#client, this.#httpRequest, request));
961
969
  }
970
+ /**
971
+ * Run a raw instruction and return the result either as text or json
972
+ * @param request - prompt request
973
+ */
974
+ prompt(request) {
975
+ return rxjs.lastValueFrom(_prompt(this.#client, this.#httpRequest, request));
976
+ }
962
977
  }
963
978
  class ObservableAssetsClient {
964
979
  #client;
@@ -2401,7 +2416,7 @@ function defineDeprecatedCreateClient(createClient2) {
2401
2416
  return config.printNoDefaultExport(), createClient2(config$1);
2402
2417
  };
2403
2418
  }
2404
- var name = "@sanity/client", version = "7.2.0";
2419
+ var name = "@sanity/client", version = "7.2.1-agent-actions.0";
2405
2420
  const middleware = [
2406
2421
  middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
2407
2422
  middleware$1.headers({ "User-Agent": `${name} ${version}` }),