You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8c2d301
Browse filesBrowse the repository at this point in the historyBrowse files
greeting = client.llm_gateway_generate_text("In one sentence, generate a greeting message", "sfdc_ai__DefaultGPT52")
335
+
336
+
if __name__ == "__main__":
337
+
main()
338
+
```
339
+
340
+
In order to test this code on your local machine before deploying it to Data Cloud, you must first set up an External Client App that allows access to the Agent API. Follow this guide to create the ECA https://developer.salesforce.com/docs/ai/agentforce/guide/agent-api-get-started.html#create-a-salesforce-app. You must use `http://localhost:1717/OauthRedirect` as the callback URL.
341
+
342
+
Once the ECA is set up, log in to your org using this ECA
343
+
```
344
+
sf org login web \
345
+
--alias myorg \
346
+
--instance-url https://{MY_DOMAIN_URL} \
347
+
--client-id {CONSUMER_KEY} \
348
+
--scopes "sfap_api api"
349
+
```
350
+
351
+
then you can test your code using `myorg` alias
352
+
```
353
+
datacustomcode run ./payload/entrypoint.py --sf-cli-org myorg
354
+
```
355
+
356
+
308
357
## Docker usage
309
358
310
359
The SDK provides Docker-based development options that allow you to test your code in an environment that closely resembles Data Cloud's execution environment.
0 commit comments