Learn how to extend Polyglot with custom providers and middleware.
CanMapMessages
to convert Polyglot’s message format to the provider’s formatCanMapRequestBody
to structure the request body according to the provider’s APIProviderRequestAdapter
to build HTTP requests for the providerProviderResponseAdapter
to parse responses from the providerCanMapUsage
to extract token usage informationInferenceDriverFactory
to create the appropriate driver for your provider:
make
method’s match statement.
CanVectorize
interface:
Embeddings
class to create your driver: