JinaProvider
class JinaProvider extends Provider implements EmbeddingProvider, RerankingProvider
Traits
Properties
| protected EmbeddingGateway | $embeddingGateway | from HasEmbeddingGateway | |
| protected RerankingGateway | $rerankingGateway | from HasRerankingGateway |
Methods
Get the provider connection configuration other than the driver, key, and name.
Get a provider instance that sends the given HTTP headers with each request.
Run the given gateway call, dispatching the event built from its exception before rethrowing.
Format the given provider / model list.
Get provider and model pairs without discarding on-demand instances.
Restore the provider from its serialized representation.
Get embedding vectors representing the given inputs.
Determine if the provider may omit dimensions and use a model's native embedding dimensions.
Validate embeddings inputs against the provider's supported media types.
Get the provider's embedding gateway.
Get the provider's reranking gateway.
Rerank the given documents based on their relevance to the query.
Get the name of the default embeddings model.
Get the default dimensions of the default embeddings model.
Get the name of the default reranking model.
Details
at line 28
__construct(array $config, Dispatcher $events)
Create a Jina provider instance.
in
Provider at line 34
string
name()
Get the name of the underlying AI provider.
in
Provider at line 42
string
driver()
Get the name of the underlying AI driver.
in
Provider at line 50
array
providerCredentials()
Get the credentials for the underlying AI provider.
in
Provider at line 60
array
additionalConfiguration()
Get the provider connection configuration other than the driver, key, and name.
in
Provider at line 72
Provider
withHeaders(array $headers)
| internal |
Get a provider instance that sends the given HTTP headers with each request.
in
Provider at line 92
protected mixed
dispatchingFailure(Closure $call, Closure $failed)
Run the given gateway call, dispatching the event built from its exception before rethrowing.
in
Provider at line 114
static array
formatProviderAndModelList(Provider|Lab|array|string $providers, string|null $model = null)
Format the given provider / model list.
in
Provider at line 132
static array
providerAndModelPairs(Provider|Lab|array|string $providers, string|null $model = null)
| internal |
Get provider and model pairs without discarding on-demand instances.
in
Provider at line 164
array
__serialize()
Get the serializable representation of the provider.
in
Provider at line 174
void
__unserialize(array $data)
Restore the provider from its serialized representation.
in
Provider at line 190
string
__toString()
Convert the provider to its string representation.
in
GeneratesEmbeddings at line 29
EmbeddingsResponse
embeddings(array $inputs, int|null $dimensions = null, string|null $model = null, int $timeout = 30, array $providerOptions = [])
Get embedding vectors representing the given inputs.
in
GeneratesEmbeddings at line 87
protected bool
supportsNativeEmbeddingDimensions()
Determine if the provider may omit dimensions and use a model's native embedding dimensions.
in
GeneratesEmbeddings at line 97
protected void
validateEmbeddingInputs(array $inputs, string $model)
Validate embeddings inputs against the provider's supported media types.
at line 53
EmbeddingGateway
embeddingGateway()
Get the provider's embedding gateway.
in
HasEmbeddingGateway at line 27
HasEmbeddingGateway
useEmbeddingGateway(EmbeddingGateway $gateway)
Set the provider's embedding gateway.
Changing a shared provider's gateway affects subsequent operations.
at line 69
RerankingGateway
rerankingGateway()
Get the provider's reranking gateway.
in
HasRerankingGateway at line 27
HasRerankingGateway
useRerankingGateway(RerankingGateway $gateway)
Set the provider's reranking gateway.
Changing a shared provider's gateway affects subsequent operations.
in
Reranks at line 24
RerankingResponse
rerank(array $documents, string $query, int|null $limit = null, string|null $model = null, int $timeout = 30, array $providerOptions = [])
Rerank the given documents based on their relevance to the query.
at line 37
string
defaultEmbeddingsModel()
Get the name of the default embeddings model.
at line 45
int
defaultEmbeddingsDimensions()
Get the default dimensions of the default embeddings model.
at line 61
string
defaultRerankingModel()
Get the name of the default reranking model.