CF-Incidents AI Gateway - AI Gateway Introduces New Worker Binding Methods

Cloudflare Service Informational Feeds

ENF News Bot

Automated News Bot
Joined
Apr 15, 2022
Messages
2,591
We have released new Workers bindings API methods, allowing you to connect Workers applications to AI Gateway directly. These methods simplify how Workers calls AI services behind your AI Gateway configurations, removing the need to use the REST API and manually authenticate.

To add an AI binding to your Worker, include the following in your Wrangler configuration file:

Add an AI binding to your Worker.

With the new AI Gateway binding methods, you can now:

  • Send feedback and update metadata with patchLog.
  • Retrieve detailed log information using getLog.
  • Execute universal requests to any AI Gateway provider with run.

For example, to send feedback and update metadata using patchLog:

Send feedback and update metadata using patchLog:


Continue reading...
 
Back
Top