jina

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package jina integrates Jina Search and Jina Reader with the provider-neutral web contracts.

A Client implements both web.Searcher and web.Fetcher. The two capabilities have distinct upstream base URLs, configured through Config.SearchBaseURL and Config.FetchBaseURL, while sharing credentials and HTTP transport.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements the web contracts against Jina's reader and search endpoints. It holds two HTTP clients for the two base URLs rather than rewriting the host per call, so each endpoint's configuration stays independent.

func NewClient

func NewClient(config Config) (*Client, error)

NewClient requires the API key at construction so a missing credential fails at wiring rather than as an authorization error on a model's first call.

func (*Client) Fetch

func (c *Client) Fetch(ctx context.Context, request *web.FetchRequest) (*web.FetchResponse, error)

func (*Client) Search

func (c *Client) Search(ctx context.Context, request *web.SearchRequest) (*web.SearchResponse, error)

type Config

type Config struct {
	APIKey        string
	SearchBaseURL string
	FetchBaseURL  string
	HTTPClient    *http.Client
}

Config carries separate search and fetch base URLs because Jina serves the two capabilities from different endpoints; one shared base would silently send half the calls to the wrong service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL