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

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.
@@ -1058,6 +1058,14 @@ function _generate(client, httpRequest, request) {
1058
1058
  body: request
1059
1059
  });
1060
1060
  }
1061
+ function _prompt(client, httpRequest, request) {
1062
+ const dataset2 = hasDataset(client.config());
1063
+ return _request(client, httpRequest, {
1064
+ method: "POST",
1065
+ uri: `/agent/action/prompt/${dataset2}`,
1066
+ body: request
1067
+ });
1068
+ }
1061
1069
  function _transform(client, httpRequest, request) {
1062
1070
  const dataset2 = hasDataset(client.config());
1063
1071
  return _request(client, httpRequest, {
@@ -1129,6 +1137,13 @@ class AgentActionsClient {
1129
1137
  translate(request) {
1130
1138
  return rxjs.lastValueFrom(_translate(this.#client, this.#httpRequest, request));
1131
1139
  }
1140
+ /**
1141
+ * Run a raw instruction and return the result either as text or json
1142
+ * @param request - prompt request
1143
+ */
1144
+ prompt(request) {
1145
+ return rxjs.lastValueFrom(_prompt(this.#client, this.#httpRequest, request));
1146
+ }
1132
1147
  }
1133
1148
  class ObservableAssetsClient {
1134
1149
  #client;