integration

package
v0.0.95 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package integration provides utilities for integration with external systems, services, and frameworks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToOpenAIChatCompletionMessages added in v0.0.56

func ToOpenAIChatCompletionMessages(messages schema.ChatMessages) ([]openai.ChatCompletionMessage, error)

ToOpenAIChatCompletionMessages converts a slice of schema.ChatMessage to a slice of openai.ChatCompletionMessage. It extracts the necessary information from each message to create the corresponding OpenAI chat completion message.

Types

type HTTPClient added in v0.0.58

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type PartitionInput added in v0.0.85

type PartitionInput struct {
	File *os.File
}

PartitionInput represents the input for the Partition method.

type PartitionOutput added in v0.0.85

type PartitionOutput struct {
	Type      string `json:"type"`
	ElementID string `json:"element_id"`
	Metadata  struct {
		Filetype   string   `json:"filetype"`
		Languages  []string `json:"languages"`
		PageNumber int      `json:"page_number"`
		Filename   string   `json:"filename"`
	} `json:"metadata"`
	Text string `json:"text"`
}

PartitionOutput represents the output of the Partition method.

type SerpAPI

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

func NewSerpAPI

func NewSerpAPI(apiKey string) (*SerpAPI, error)

func (*SerpAPI) Run

func (s *SerpAPI) Run(ctx context.Context, query string) (string, error)

type SerpAPIOptions

type SerpAPIOptions struct {
	Parameter map[string]string
}

type Unstructured added in v0.0.85

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

Unstructured is a client for interacting with the Unstructured API.

func NewUnstructured added in v0.0.85

func NewUnstructured(apiKey string, optFns ...func(o *UnstructuredOptions)) *Unstructured

NewUnstructured creates a new Unstructured client with the provided API key.

func (*Unstructured) Partition added in v0.0.85

func (c *Unstructured) Partition(ctx context.Context, input *PartitionInput) ([]PartitionOutput, error)

Partition sends a file to the Unstructured API for partitioning and returns the partitioned content.

type UnstructuredOptions added in v0.0.85

type UnstructuredOptions struct {
	// BaseURL is the base URL of the Unstructured API.
	BaseURL string

	// HTTPClient is the HTTP client to use for making API requests.
	HTTPClient HTTPClient
}

UnstructuredOptions represents options for configuring the Unstructured client.

type Wikipedia added in v0.0.4

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

func NewWikipedia added in v0.0.4

func NewWikipedia(optFns ...func(o *WikipediaOptions)) *Wikipedia

func (*Wikipedia) Run added in v0.0.4

func (w *Wikipedia) Run(ctx context.Context, query string) (string, error)

type WikipediaOptions added in v0.0.4

type WikipediaOptions struct {
	LanguageCode string
	TopK         int
	DocMaxChars  int
	HTTPClient   HTTPClient
}

Directories

Path Synopsis
Package ai21 provides a client for interacting with the ai21 text completion API.
Package ai21 provides a client for interacting with the ai21 text completion API.
Package ernie provides a client library for interacting with the Ernie API, which offers natural language processing (NLP) capabilities, including chat completion and text embedding.
Package ernie provides a client library for interacting with the Ernie API, which offers natural language processing (NLP) capabilities, including chat completion and text embedding.
Package nbformat provides utilities to read and parse Jupyter Notebook (nbformat) files.
Package nbformat provides utilities to read and parse Jupyter Notebook (nbformat) files.
Package sqldb provides an SQL database abstraction for performing queries and interacting with the database.
Package sqldb provides an SQL database abstraction for performing queries and interacting with the database.

Jump to

Keyboard shortcuts

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