azopenaiextensions

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 10 Imported by: 0

README

Azure OpenAI extensions module for Go

This module provides models and convenience functions to make it simpler to use Azure OpenAI features, such as Azure OpenAI On Your Data, with the OpenAI Go client (https://pkg.go.dev/github.com/openai/openai-go).

Source code | Package (pkg.go.dev) | REST API documentation | Product documentation

Getting started

Prerequisites
Install the packages

Install the azopenaiextensions and azidentity modules with go get:

go get github.com/Azure/azure-sdk-for-go/sdk/ai/azopenaiextensions

# optional
go get github.com/Azure/azure-sdk-for-go/sdk/azidentity

The azidentity module is used for Azure Active Directory authentication with Azure OpenAI.

Key concepts

See Key concepts in the product documentation for more details about general concepts.

Examples

Examples for scenarios specific to Azure can be found on pkg.go.dev or in the example*_test.go files in our GitHub repo for azopenaiextensions.

For examples on using the openai-go client, see the examples in the openai-go repository.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Overview

Example (UsingAzureOnYourData)
endpoint := os.Getenv("AOAI_OYD_ENDPOINT")
model := os.Getenv("AOAI_OYD_MODEL")
cognitiveSearchEndpoint := os.Getenv("COGNITIVE_SEARCH_API_ENDPOINT") // Ex: https://<your-service>.search.windows.net
cognitiveSearchIndexName := os.Getenv("COGNITIVE_SEARCH_API_INDEX")

if endpoint == "" || model == "" || cognitiveSearchEndpoint == "" || cognitiveSearchIndexName == "" {
	fmt.Fprintf(os.Stderr, "Environment variables are not set, not \nrunning example.")
	return
}

tokenCredential, err := azidentity.NewDefaultAzureCredential(nil)

if err != nil {
	//  TODO: Update the following line with your application specific error handling logic
	fmt.Fprintf(os.Stderr, "ERROR: %s\n", err)
	return
}

client := openai.NewClient(
	azure.WithEndpoint(endpoint, "2024-08-01-preview"),
	azure.WithTokenCredential(tokenCredential),
)

chatParams := openai.ChatCompletionNewParams{
	Model:     openai.F(model),
	MaxTokens: openai.Int(512),
	Messages: openai.F([]openai.ChatCompletionMessageParamUnion{
		openai.ChatCompletionMessageParam{
			Role:    openai.F(openai.ChatCompletionMessageParamRoleUser),
			Content: openai.F[any]("What does the OpenAI package do?"),
		},
	}),
}

// There are other types of data sources available. Examples:
//
// - AzureCosmosDBChatExtensionConfiguration
// - AzureMachineLearningIndexChatExtensionConfiguration
// - AzureSearchChatExtensionConfiguration
// - PineconeChatExtensionConfiguration
//
// See the definition of [AzureChatExtensionConfigurationClassification] for a full list.
azureSearchDataSource := &azopenaiextensions.AzureSearchChatExtensionConfiguration{
	Parameters: &azopenaiextensions.AzureSearchChatExtensionParameters{
		Endpoint:       &cognitiveSearchEndpoint,
		IndexName:      &cognitiveSearchIndexName,
		Authentication: &azopenaiextensions.OnYourDataSystemAssignedManagedIdentityAuthenticationOptions{},
	},
}

resp, err := client.Chat.Completions.New(
	context.TODO(),
	chatParams,
	azopenaiextensions.WithDataSources(azureSearchDataSource),
)

if err != nil {
	//  TODO: Update the following line with your application specific error handling logic
	fmt.Fprintf(os.Stderr, "ERROR: %s\n", err)
	return
}

for _, chatChoice := range resp.Choices {
	// Azure-specific response data can be extracted using helpers, like [azopenaiextensions.ChatCompletionChoice].
	azureChatChoice := azopenaiextensions.ChatCompletionChoice(chatChoice)
	azureContentFilterResult, err := azureChatChoice.ContentFilterResults()

	if err != nil {
		//  TODO: Update the following line with your application specific error handling logic
		fmt.Fprintf(os.Stderr, "ERROR: %s\n", err)
		return
	}

	if azureContentFilterResult != nil {
		fmt.Fprintf(os.Stderr, "ContentFilterResult: %#v\n", azureContentFilterResult)
	}

	// there are also helpers for individual types, not just top-level response types.
	azureChatCompletionMsg := azopenaiextensions.ChatCompletionMessage(chatChoice.Message)
	msgContext, err := azureChatCompletionMsg.Context()

	if err != nil {
		//  TODO: Update the following line with your application specific error handling logic
		fmt.Fprintf(os.Stderr, "ERROR: %s\n", err)
		return
	}

	for _, citation := range msgContext.Citations {
		if citation.Content != nil {
			fmt.Fprintf(os.Stderr, "Citation = %s\n", *citation.Content)
		}
	}

	// the original fields from the type are also still available.
	fmt.Fprintf(os.Stderr, "Content: %s\n", azureChatCompletionMsg.Content)
}

fmt.Fprintf(os.Stderr, "Example complete\n")
Output:

Example (UsingEnhancements)
endpoint := os.Getenv("AOAI_OYD_ENDPOINT")
model := os.Getenv("AOAI_OYD_MODEL")
cognitiveSearchEndpoint := os.Getenv("COGNITIVE_SEARCH_API_ENDPOINT") // Ex: https://<your-service>.search.windows.net
cognitiveSearchIndexName := os.Getenv("COGNITIVE_SEARCH_API_INDEX")

if endpoint == "" || model == "" || cognitiveSearchEndpoint == "" || cognitiveSearchIndexName == "" {
	fmt.Fprintf(os.Stderr, "Environment variables are not set, not \nrunning example.")
	return
}

tokenCredential, err := azidentity.NewDefaultAzureCredential(nil)

if err != nil {
	//  TODO: Update the following line with your application specific error handling logic
	fmt.Fprintf(os.Stderr, "ERROR: %s\n", err)
	return
}

client := openai.NewClient(
	azure.WithEndpoint(endpoint, "2024-08-01-preview"),
	azure.WithTokenCredential(tokenCredential),
)

chatParams := openai.ChatCompletionNewParams{
	Model:     openai.F(model),
	MaxTokens: openai.Int(512),
	Messages: openai.F([]openai.ChatCompletionMessageParamUnion{
		openai.ChatCompletionMessageParam{
			Role:    openai.F(openai.ChatCompletionMessageParamRoleUser),
			Content: openai.F[any]("What does the OpenAI package do?"),
		},
	}),
}

resp, err := client.Chat.Completions.New(
	context.TODO(),
	chatParams,
	azopenaiextensions.WithEnhancements(azopenaiextensions.AzureChatEnhancementConfiguration{
		Grounding: &azopenaiextensions.AzureChatGroundingEnhancementConfiguration{
			Enabled: to.Ptr(true),
		},
	}),
)

if err != nil {
	//  TODO: Update the following line with your application specific error handling logic
	fmt.Fprintf(os.Stderr, "ERROR: %s\n", err)
	return
}

for _, chatChoice := range resp.Choices {
	// Azure-specific response data can be extracted using helpers, like [azopenaiextensions.ChatCompletionChoice].
	azureChatChoice := azopenaiextensions.ChatCompletionChoice(chatChoice)
	azureContentFilterResult, err := azureChatChoice.ContentFilterResults()

	if err != nil {
		//  TODO: Update the following line with your application specific error handling logic
		fmt.Fprintf(os.Stderr, "ERROR: %s\n", err)
		return
	}

	if azureContentFilterResult != nil {
		fmt.Fprintf(os.Stderr, "ContentFilterResult: %#v\n", azureContentFilterResult)
	}

	// there are also helpers for individual types, not just top-level response types.
	azureChatCompletionMsg := azopenaiextensions.ChatCompletionMessage(chatChoice.Message)
	msgContext, err := azureChatCompletionMsg.Context()

	if err != nil {
		//  TODO: Update the following line with your application specific error handling logic
		fmt.Fprintf(os.Stderr, "ERROR: %s\n", err)
		return
	}

	for _, citation := range msgContext.Citations {
		if citation.Content != nil {
			fmt.Fprintf(os.Stderr, "Citation = %s\n", *citation.Content)
		}
	}

	// the original fields from the type are also still available.
	fmt.Fprintf(os.Stderr, "Content: %s\n", azureChatCompletionMsg.Content)
}

fmt.Fprintf(os.Stderr, "Example complete\n")
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractContentFilterError

func ExtractContentFilterError(err error, contentFilterErr **ContentFilterError) bool

ExtractContentFilterError checks the error to see if it contains content filtering information. If so it'll assign the resulting information to *contentFilterErr, similar to errors.As().

Prompt filtering information will be present if you see an error message similar to this: 'The response was filtered due to the prompt triggering'. (NOTE: error message is for illustrative purposes, and can change).

Usage looks like this:

resp, err := chatCompletionsService.New(args)

var contentFilterErr *azopenaiextensions.ContentFilterError

if openai.ExtractContentFilterError(err, &contentFilterErr) {
	// contentFilterErr.Hate, contentFilterErr.SelfHarm, contentFilterErr.Sexual or contentFilterErr.Violence
	// contain information about why content was flagged.
}

func WithDataSources

WithDataSources adds in Azure data sources to be used with the "Azure OpenAI On Your Data" feature.

func WithEnhancements

WithEnhancements configures Azure OpenAI enhancements, optical character recognition (OCR).

Types

type AzureChatEnhancementConfiguration

type AzureChatEnhancementConfiguration struct {
	// A representation of the available options for the Azure OpenAI grounding enhancement.
	Grounding *AzureChatGroundingEnhancementConfiguration

	// A representation of the available options for the Azure OpenAI optical character recognition (OCR) enhancement.
	Ocr *AzureChatOCREnhancementConfiguration
}

AzureChatEnhancementConfiguration - A representation of the available Azure OpenAI enhancement configurations.

func (AzureChatEnhancementConfiguration) MarshalJSON

func (a AzureChatEnhancementConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureChatEnhancementConfiguration.

func (*AzureChatEnhancementConfiguration) UnmarshalJSON

func (a *AzureChatEnhancementConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureChatEnhancementConfiguration.

type AzureChatEnhancements

type AzureChatEnhancements struct {
	// The grounding enhancement that returns the bounding box of the objects detected in the image.
	Grounding *AzureGroundingEnhancement
}

AzureChatEnhancements - Represents the output results of Azure enhancements to chat completions, as configured via the matching input provided in the request.

func (AzureChatEnhancements) MarshalJSON

func (a AzureChatEnhancements) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureChatEnhancements.

func (*AzureChatEnhancements) UnmarshalJSON

func (a *AzureChatEnhancements) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureChatEnhancements.

type AzureChatExtensionConfiguration

type AzureChatExtensionConfiguration struct {
	// REQUIRED; The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. Azure
	// chat extensions are only compatible with Azure OpenAI.
	Type *AzureChatExtensionType
}

AzureChatExtensionConfiguration - A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat completions request that should use Azure OpenAI chat extensions to augment the response behavior. The use of this configuration is compatible only with Azure OpenAI.

func (*AzureChatExtensionConfiguration) GetAzureChatExtensionConfiguration

func (a *AzureChatExtensionConfiguration) GetAzureChatExtensionConfiguration() *AzureChatExtensionConfiguration

GetAzureChatExtensionConfiguration implements the AzureChatExtensionConfigurationClassification interface for type AzureChatExtensionConfiguration.

func (AzureChatExtensionConfiguration) MarshalJSON

func (a AzureChatExtensionConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureChatExtensionConfiguration.

func (*AzureChatExtensionConfiguration) UnmarshalJSON

func (a *AzureChatExtensionConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureChatExtensionConfiguration.

type AzureChatExtensionConfigurationClassification

type AzureChatExtensionConfigurationClassification interface {
	// GetAzureChatExtensionConfiguration returns the AzureChatExtensionConfiguration content of the underlying type.
	GetAzureChatExtensionConfiguration() *AzureChatExtensionConfiguration
}

AzureChatExtensionConfigurationClassification provides polymorphic access to related types. Call the interface's GetAzureChatExtensionConfiguration() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *AzureChatExtensionConfiguration, *AzureCosmosDBChatExtensionConfiguration, *AzureSearchChatExtensionConfiguration, *ElasticsearchChatExtensionConfiguration, - *MongoDBChatExtensionConfiguration, *PineconeChatExtensionConfiguration

type AzureChatExtensionDataSourceResponseCitation

type AzureChatExtensionDataSourceResponseCitation struct {
	// REQUIRED; The content of the citation.
	Content *string

	// The chunk ID of the citation.
	ChunkID *string

	// The file path of the citation.
	Filepath *string

	// The rerank score of the retrieved document.
	RerankScore *float64

	// The title of the citation.
	Title *string

	// The URL of the citation.
	URL *string
}

AzureChatExtensionDataSourceResponseCitation - A single instance of additional context information available when Azure OpenAI chat extensions are involved in the generation of a corresponding chat completions response. This context information is only populated when using an Azure OpenAI request configured to use a matching extension.

func (AzureChatExtensionDataSourceResponseCitation) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type AzureChatExtensionDataSourceResponseCitation.

func (*AzureChatExtensionDataSourceResponseCitation) UnmarshalJSON

func (a *AzureChatExtensionDataSourceResponseCitation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureChatExtensionDataSourceResponseCitation.

type AzureChatExtensionRetrieveDocumentFilterReason

type AzureChatExtensionRetrieveDocumentFilterReason string

AzureChatExtensionRetrieveDocumentFilterReason - The reason for filtering the retrieved document.

const (
	// AzureChatExtensionRetrieveDocumentFilterReasonRerank - The document is not filtered by original search score threshold,
	// but is filtered by rerank score and `top_n_documents` configure.
	AzureChatExtensionRetrieveDocumentFilterReasonRerank AzureChatExtensionRetrieveDocumentFilterReason = "rerank"
	// AzureChatExtensionRetrieveDocumentFilterReasonScore - The document is filtered by original search score threshold defined
	// by `strictness` configure.
	AzureChatExtensionRetrieveDocumentFilterReasonScore AzureChatExtensionRetrieveDocumentFilterReason = "score"
)

func PossibleAzureChatExtensionRetrieveDocumentFilterReasonValues

func PossibleAzureChatExtensionRetrieveDocumentFilterReasonValues() []AzureChatExtensionRetrieveDocumentFilterReason

PossibleAzureChatExtensionRetrieveDocumentFilterReasonValues returns the possible values for the AzureChatExtensionRetrieveDocumentFilterReason const type.

type AzureChatExtensionRetrievedDocument

type AzureChatExtensionRetrievedDocument struct {
	// REQUIRED; The content of the citation.
	Content *string

	// REQUIRED; The index of the data source.
	DataSourceIndex *int32

	// REQUIRED; The search queries used to retrieve the document.
	SearchQueries []string

	// The chunk ID of the citation.
	ChunkID *string

	// The file path of the citation.
	Filepath *string

	// Represents the rationale for filtering the document. If the document does not undergo filtering, this field will remain
	// unset.
	FilterReason *AzureChatExtensionRetrieveDocumentFilterReason

	// The original search score of the retrieved document.
	OriginalSearchScore *float64

	// The rerank score of the retrieved document.
	RerankScore *float64

	// The title of the citation.
	Title *string

	// The URL of the citation.
	URL *string
}

AzureChatExtensionRetrievedDocument - The retrieved document.

func (AzureChatExtensionRetrievedDocument) MarshalJSON

func (a AzureChatExtensionRetrievedDocument) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureChatExtensionRetrievedDocument.

func (*AzureChatExtensionRetrievedDocument) UnmarshalJSON

func (a *AzureChatExtensionRetrievedDocument) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureChatExtensionRetrievedDocument.

type AzureChatExtensionType

type AzureChatExtensionType string

AzureChatExtensionType - A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat completions request that should use Azure OpenAI chat extensions to augment the response behavior. The use of this configuration is compatible only with Azure OpenAI.

const (
	// AzureChatExtensionTypeAzureCosmosDB - Represents the use of Azure Cosmos DB as an Azure OpenAI chat extension.
	AzureChatExtensionTypeAzureCosmosDB AzureChatExtensionType = "azure_cosmos_db"
	// AzureChatExtensionTypeAzureSearch - Represents the use of Azure AI Search as an Azure OpenAI chat extension.
	AzureChatExtensionTypeAzureSearch AzureChatExtensionType = "azure_search"
	// AzureChatExtensionTypeElasticsearch - Represents the use of Elasticsearch® index as an Azure OpenAI chat extension.
	AzureChatExtensionTypeElasticsearch AzureChatExtensionType = "elasticsearch"
	// AzureChatExtensionTypeMongoDB - Represents the use of a MongoDB chat extension.
	AzureChatExtensionTypeMongoDB AzureChatExtensionType = "mongo_db"
	// AzureChatExtensionTypePinecone - Represents the use of Pinecone index as an Azure OpenAI chat extension.
	AzureChatExtensionTypePinecone AzureChatExtensionType = "pinecone"
)

func PossibleAzureChatExtensionTypeValues

func PossibleAzureChatExtensionTypeValues() []AzureChatExtensionType

PossibleAzureChatExtensionTypeValues returns the possible values for the AzureChatExtensionType const type.

type AzureChatExtensionsMessageContext

type AzureChatExtensionsMessageContext struct {
	// All the retrieved documents.
	AllRetrievedDocuments []AzureChatExtensionRetrievedDocument

	// The contextual information associated with the Azure chat extensions used for a chat completions request. These messages
	// describe the data source retrievals, plugin invocations, and other intermediate
	// steps taken in the course of generating a chat completions response that was augmented by capabilities from Azure OpenAI
	// chat extensions.
	Citations []AzureChatExtensionDataSourceResponseCitation

	// The detected intent from the chat history, used to pass to the next turn to carry over the context.
	Intent *string
}

AzureChatExtensionsMessageContext - A representation of the additional context information available when Azure OpenAI chat extensions are involved in the generation of a corresponding chat completions response. This context information is only populated when using an Azure OpenAI request configured to use a matching extension.

func (AzureChatExtensionsMessageContext) MarshalJSON

func (a AzureChatExtensionsMessageContext) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureChatExtensionsMessageContext.

func (*AzureChatExtensionsMessageContext) UnmarshalJSON

func (a *AzureChatExtensionsMessageContext) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureChatExtensionsMessageContext.

type AzureChatGroundingEnhancementConfiguration

type AzureChatGroundingEnhancementConfiguration struct {
	// REQUIRED; Specifies whether the enhancement is enabled.
	Enabled *bool
}

AzureChatGroundingEnhancementConfiguration - A representation of the available options for the Azure OpenAI grounding enhancement.

func (AzureChatGroundingEnhancementConfiguration) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type AzureChatGroundingEnhancementConfiguration.

func (*AzureChatGroundingEnhancementConfiguration) UnmarshalJSON

func (a *AzureChatGroundingEnhancementConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureChatGroundingEnhancementConfiguration.

type AzureChatOCREnhancementConfiguration

type AzureChatOCREnhancementConfiguration struct {
	// REQUIRED; Specifies whether the enhancement is enabled.
	Enabled *bool
}

AzureChatOCREnhancementConfiguration - A representation of the available options for the Azure OpenAI optical character recognition (OCR) enhancement.

func (AzureChatOCREnhancementConfiguration) MarshalJSON

func (a AzureChatOCREnhancementConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureChatOCREnhancementConfiguration.

func (*AzureChatOCREnhancementConfiguration) UnmarshalJSON

func (a *AzureChatOCREnhancementConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureChatOCREnhancementConfiguration.

type AzureCosmosDBChatExtensionConfiguration

type AzureCosmosDBChatExtensionConfiguration struct {
	// REQUIRED; The parameters to use when configuring Azure OpenAI CosmosDB chat extensions.
	Parameters *AzureCosmosDBChatExtensionParameters

	// REQUIRED; The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. Azure
	// chat extensions are only compatible with Azure OpenAI.
	Type *AzureChatExtensionType
}

AzureCosmosDBChatExtensionConfiguration - A specific representation of configurable options for Azure Cosmos DB when using it as an Azure OpenAI chat extension.

func (*AzureCosmosDBChatExtensionConfiguration) GetAzureChatExtensionConfiguration

func (a *AzureCosmosDBChatExtensionConfiguration) GetAzureChatExtensionConfiguration() *AzureChatExtensionConfiguration

GetAzureChatExtensionConfiguration implements the AzureChatExtensionConfigurationClassification interface for type AzureCosmosDBChatExtensionConfiguration.

func (AzureCosmosDBChatExtensionConfiguration) MarshalJSON

func (a AzureCosmosDBChatExtensionConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureCosmosDBChatExtensionConfiguration.

func (*AzureCosmosDBChatExtensionConfiguration) UnmarshalJSON

func (a *AzureCosmosDBChatExtensionConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureCosmosDBChatExtensionConfiguration.

type AzureCosmosDBChatExtensionParameters

type AzureCosmosDBChatExtensionParameters struct {
	// REQUIRED; The name of the Azure Cosmos DB resource container.
	ContainerName *string

	// REQUIRED; The MongoDB vCore database name to use with Azure Cosmos DB.
	DatabaseName *string

	// REQUIRED; The embedding dependency for vector search.
	EmbeddingDependency OnYourDataVectorizationSourceClassification

	// REQUIRED; Customized field mapping behavior to use when interacting with the search index.
	FieldsMapping *AzureCosmosDBFieldMappingOptions

	// REQUIRED; The MongoDB vCore index name to use with Azure Cosmos DB.
	IndexName *string

	// If specified as true, the system will allow partial search results to be used and the request fails if all the queries
	// fail. If not specified, or specified as false, the request will fail if any
	// search query fails.
	AllowPartialResult *bool

	// The authentication method to use when accessing the defined data source. Each data source type supports a specific set
	// of available authentication methods; please see the documentation of the data
	// source for supported mechanisms. If not otherwise provided, On Your Data will attempt to use System Managed Identity (default
	// credential) authentication.
	Authentication OnYourDataAuthenticationOptionsClassification

	// Whether queries should be restricted to use of indexed data.
	InScope *bool

	// The included properties of the output context. If not specified, the default value is citations and intent.
	IncludeContexts []OnYourDataContextProperty

	// The max number of rewritten queries should be send to search provider for one user message. If not specified, the system
	// will decide the number of queries to send.
	MaxSearchQueries *int32

	// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but
	// lower recall of the answer.
	Strictness *int32

	// The configured top number of documents to feature for the configured query.
	TopNDocuments *int32
}

AzureCosmosDBChatExtensionParameters - Parameters to use when configuring Azure OpenAI On Your Data chat extensions when using Azure Cosmos DB for MongoDB vCore. The supported authentication type is ConnectionString.

func (AzureCosmosDBChatExtensionParameters) MarshalJSON

func (a AzureCosmosDBChatExtensionParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureCosmosDBChatExtensionParameters.

func (*AzureCosmosDBChatExtensionParameters) UnmarshalJSON

func (a *AzureCosmosDBChatExtensionParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureCosmosDBChatExtensionParameters.

type AzureCosmosDBFieldMappingOptions

type AzureCosmosDBFieldMappingOptions struct {
	// REQUIRED; The names of index fields that should be treated as content.
	ContentFields []string

	// REQUIRED; The names of fields that represent vector data.
	VectorFields []string

	// The separator pattern that content fields should use.
	ContentFieldsSeparator *string

	// The name of the index field to use as a filepath.
	FilepathField *string

	// The name of the index field to use as a title.
	TitleField *string

	// The name of the index field to use as a URL.
	URLField *string
}

AzureCosmosDBFieldMappingOptions - Optional settings to control how fields are processed when using a configured Azure Cosmos DB resource.

func (AzureCosmosDBFieldMappingOptions) MarshalJSON

func (a AzureCosmosDBFieldMappingOptions) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureCosmosDBFieldMappingOptions.

func (*AzureCosmosDBFieldMappingOptions) UnmarshalJSON

func (a *AzureCosmosDBFieldMappingOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureCosmosDBFieldMappingOptions.

type AzureGroundingEnhancement

type AzureGroundingEnhancement struct {
	// REQUIRED; The lines of text detected by the grounding enhancement.
	Lines []AzureGroundingEnhancementLine
}

AzureGroundingEnhancement - The grounding enhancement that returns the bounding box of the objects detected in the image.

func (AzureGroundingEnhancement) MarshalJSON

func (a AzureGroundingEnhancement) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureGroundingEnhancement.

func (*AzureGroundingEnhancement) UnmarshalJSON

func (a *AzureGroundingEnhancement) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureGroundingEnhancement.

type AzureGroundingEnhancementCoordinatePoint

type AzureGroundingEnhancementCoordinatePoint struct {
	// REQUIRED; The x-coordinate (horizontal axis) of the point.
	X *float32

	// REQUIRED; The y-coordinate (vertical axis) of the point.
	Y *float32
}

AzureGroundingEnhancementCoordinatePoint - A representation of a single polygon point as used by the Azure grounding enhancement.

func (AzureGroundingEnhancementCoordinatePoint) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type AzureGroundingEnhancementCoordinatePoint.

func (*AzureGroundingEnhancementCoordinatePoint) UnmarshalJSON

func (a *AzureGroundingEnhancementCoordinatePoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureGroundingEnhancementCoordinatePoint.

type AzureGroundingEnhancementLine

type AzureGroundingEnhancementLine struct {
	// REQUIRED; An array of spans that represent detected objects and its bounding box information.
	Spans []AzureGroundingEnhancementLineSpan

	// REQUIRED; The text within the line.
	Text *string
}

AzureGroundingEnhancementLine - A content line object consisting of an adjacent sequence of content elements, such as words and selection marks.

func (AzureGroundingEnhancementLine) MarshalJSON

func (a AzureGroundingEnhancementLine) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureGroundingEnhancementLine.

func (*AzureGroundingEnhancementLine) UnmarshalJSON

func (a *AzureGroundingEnhancementLine) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureGroundingEnhancementLine.

type AzureGroundingEnhancementLineSpan

type AzureGroundingEnhancementLineSpan struct {
	// REQUIRED; The length of the span in characters, measured in Unicode codepoints.
	Length *int32

	// REQUIRED; The character offset within the text where the span begins. This offset is defined as the position of the first
	// character of the span, counting from the start of the text as Unicode codepoints.
	Offset *int32

	// REQUIRED; An array of objects representing points in the polygon that encloses the detected object.
	Polygon []AzureGroundingEnhancementCoordinatePoint

	// REQUIRED; The text content of the span that represents the detected object.
	Text *string
}

AzureGroundingEnhancementLineSpan - A span object that represents a detected object and its bounding box information.

func (AzureGroundingEnhancementLineSpan) MarshalJSON

func (a AzureGroundingEnhancementLineSpan) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureGroundingEnhancementLineSpan.

func (*AzureGroundingEnhancementLineSpan) UnmarshalJSON

func (a *AzureGroundingEnhancementLineSpan) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureGroundingEnhancementLineSpan.

type AzureSearchChatExtensionConfiguration

type AzureSearchChatExtensionConfiguration struct {
	// REQUIRED; The parameters to use when configuring Azure Search.
	Parameters *AzureSearchChatExtensionParameters

	// REQUIRED; The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. Azure
	// chat extensions are only compatible with Azure OpenAI.
	Type *AzureChatExtensionType
}

AzureSearchChatExtensionConfiguration - A specific representation of configurable options for Azure Search when using it as an Azure OpenAI chat extension.

func (*AzureSearchChatExtensionConfiguration) GetAzureChatExtensionConfiguration

func (a *AzureSearchChatExtensionConfiguration) GetAzureChatExtensionConfiguration() *AzureChatExtensionConfiguration

GetAzureChatExtensionConfiguration implements the AzureChatExtensionConfigurationClassification interface for type AzureSearchChatExtensionConfiguration.

func (AzureSearchChatExtensionConfiguration) MarshalJSON

func (a AzureSearchChatExtensionConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureSearchChatExtensionConfiguration.

func (*AzureSearchChatExtensionConfiguration) UnmarshalJSON

func (a *AzureSearchChatExtensionConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureSearchChatExtensionConfiguration.

type AzureSearchChatExtensionParameters

type AzureSearchChatExtensionParameters struct {
	// REQUIRED; The absolute endpoint path for the Azure Cognitive Search resource to use.
	Endpoint *string

	// REQUIRED; The name of the index to use as available in the referenced Azure Cognitive Search resource.
	IndexName *string

	// If specified as true, the system will allow partial search results to be used and the request fails if all the queries
	// fail. If not specified, or specified as false, the request will fail if any
	// search query fails.
	AllowPartialResult *bool

	// The authentication method to use when accessing the defined data source. Each data source type supports a specific set
	// of available authentication methods; please see the documentation of the data
	// source for supported mechanisms. If not otherwise provided, On Your Data will attempt to use System Managed Identity (default
	// credential) authentication.
	Authentication OnYourDataAuthenticationOptionsClassification

	// The embedding dependency for vector search.
	EmbeddingDependency OnYourDataVectorizationSourceClassification

	// Customized field mapping behavior to use when interacting with the search index.
	FieldsMapping *AzureSearchIndexFieldMappingOptions

	// Search filter.
	Filter *string

	// Whether queries should be restricted to use of indexed data.
	InScope *bool

	// The included properties of the output context. If not specified, the default value is citations and intent.
	IncludeContexts []OnYourDataContextProperty

	// The max number of rewritten queries should be send to search provider for one user message. If not specified, the system
	// will decide the number of queries to send.
	MaxSearchQueries *int32

	// The query type to use with Azure Cognitive Search.
	QueryType *AzureSearchQueryType

	// The additional semantic configuration for the query.
	SemanticConfiguration *string

	// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but
	// lower recall of the answer.
	Strictness *int32

	// The configured top number of documents to feature for the configured query.
	TopNDocuments *int32
}

AzureSearchChatExtensionParameters - Parameters for Azure Cognitive Search when used as an Azure OpenAI chat extension. The supported authentication types are APIKey, SystemAssignedManagedIdentity and UserAssignedManagedIdentity.

func (AzureSearchChatExtensionParameters) MarshalJSON

func (a AzureSearchChatExtensionParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureSearchChatExtensionParameters.

func (*AzureSearchChatExtensionParameters) UnmarshalJSON

func (a *AzureSearchChatExtensionParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureSearchChatExtensionParameters.

type AzureSearchIndexFieldMappingOptions

type AzureSearchIndexFieldMappingOptions struct {
	// The names of index fields that should be treated as content.
	ContentFields []string

	// The separator pattern that content fields should use.
	ContentFieldsSeparator *string

	// The name of the index field to use as a filepath.
	FilepathField *string

	// The names of fields that represent image vector data.
	ImageVectorFields []string

	// The name of the index field to use as a title.
	TitleField *string

	// The name of the index field to use as a URL.
	URLField *string

	// The names of fields that represent vector data.
	VectorFields []string
}

AzureSearchIndexFieldMappingOptions - Optional settings to control how fields are processed when using a configured Azure Search resource.

func (AzureSearchIndexFieldMappingOptions) MarshalJSON

func (a AzureSearchIndexFieldMappingOptions) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureSearchIndexFieldMappingOptions.

func (*AzureSearchIndexFieldMappingOptions) UnmarshalJSON

func (a *AzureSearchIndexFieldMappingOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureSearchIndexFieldMappingOptions.

type AzureSearchQueryType

type AzureSearchQueryType string

AzureSearchQueryType - The type of Azure Search retrieval query that should be executed when using it as an Azure OpenAI chat extension.

const (
	// AzureSearchQueryTypeSemantic - Represents the semantic query parser for advanced semantic modeling.
	AzureSearchQueryTypeSemantic AzureSearchQueryType = "semantic"
	// AzureSearchQueryTypeSimple - Represents the default, simple query parser.
	AzureSearchQueryTypeSimple AzureSearchQueryType = "simple"
	// AzureSearchQueryTypeVector - Represents vector search over computed data.
	AzureSearchQueryTypeVector AzureSearchQueryType = "vector"
	// AzureSearchQueryTypeVectorSemanticHybrid - Represents a combination of semantic search and vector data querying.
	AzureSearchQueryTypeVectorSemanticHybrid AzureSearchQueryType = "vector_semantic_hybrid"
	// AzureSearchQueryTypeVectorSimpleHybrid - Represents a combination of the simple query strategy with vector data.
	AzureSearchQueryTypeVectorSimpleHybrid AzureSearchQueryType = "vector_simple_hybrid"
)

func PossibleAzureSearchQueryTypeValues

func PossibleAzureSearchQueryTypeValues() []AzureSearchQueryType

PossibleAzureSearchQueryTypeValues returns the possible values for the AzureSearchQueryType const type.

type ChatCompletion

type ChatCompletion openai.ChatCompletion

ChatCompletion wraps an openai.ChatCompletion, allowing access to Azure specific properties.

func (ChatCompletion) PromptFilterResults

func (c ChatCompletion) PromptFilterResults() ([]ContentFilterResultsForPrompt, error)

PromptFilterResults contains content filtering results for zero or more prompts in the request.

type ChatCompletionChoice

type ChatCompletionChoice openai.ChatCompletionChoice

ChatCompletionChoice wraps an openai.ChatCompletionChoice, allowing access to Azure specific properties.

func (ChatCompletionChoice) ContentFilterResults

func (c ChatCompletionChoice) ContentFilterResults() (*ContentFilterResultsForChoice, error)

ContentFilterResults contains content filtering information for this choice.

type ChatCompletionChunk

type ChatCompletionChunk openai.ChatCompletionChunk

ChatCompletionChunk wraps an openai.ChatCompletionChunk, allowing access to Azure specific properties.

func (ChatCompletionChunk) PromptFilterResults

func (c ChatCompletionChunk) PromptFilterResults() ([]ContentFilterResultsForPrompt, error)

PromptFilterResults contains content filtering results for zero or more prompts in the request. In a streaming request, results for different prompts may arrive at different times or in different orders.

type ChatCompletionChunkChoicesDelta

type ChatCompletionChunkChoicesDelta openai.ChatCompletionChunkChoicesDelta

ChatCompletionChunkChoicesDelta wraps an openai.ChatCompletionChunkChoicesDelta, allowing access to Azure specific properties.

func (ChatCompletionChunkChoicesDelta) Context

Context contains additional context information available when Azure OpenAI chat extensions are involved in the generation of a corresponding chat completions response.

type ChatCompletionMessage

type ChatCompletionMessage openai.ChatCompletionMessage

ChatCompletionMessage wraps an openai.ChatCompletionMessage, allowing access to Azure specific properties.

func (ChatCompletionMessage) Context

Context contains additional context information available when Azure OpenAI chat extensions are involved in the generation of a corresponding chat completions response.

type Completion

type Completion openai.Completion

Completion wraps an openai.Completion, allowing access to Azure specific properties.

func (Completion) PromptFilterResults

func (c Completion) PromptFilterResults() ([]ContentFilterResultsForPrompt, error)

PromptFilterResults contains content filtering results for zero or more prompts in the request.

type CompletionChoice

type CompletionChoice openai.CompletionChoice

CompletionChoice wraps an openai.CompletionChoice, allowing access to Azure specific properties.

func (CompletionChoice) ContentFilterResults

func (c CompletionChoice) ContentFilterResults() (*ContentFilterResultsForChoice, error)

ContentFilterResults contains content filtering information for this choice.

type ContentFilterBlocklistIDResult

type ContentFilterBlocklistIDResult struct {
	// REQUIRED; A value indicating whether or not the content has been filtered.
	Filtered *bool

	// REQUIRED; The ID of the custom blocklist evaluated.
	ID *string
}

ContentFilterBlocklistIDResult - Represents the outcome of an evaluation against a custom blocklist as performed by content filtering.

func (ContentFilterBlocklistIDResult) MarshalJSON

func (c ContentFilterBlocklistIDResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ContentFilterBlocklistIDResult.

func (*ContentFilterBlocklistIDResult) UnmarshalJSON

func (c *ContentFilterBlocklistIDResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ContentFilterBlocklistIDResult.

type ContentFilterCitedDetectionResult

type ContentFilterCitedDetectionResult struct {
	// REQUIRED; A value indicating whether detection occurred, irrespective of severity or whether the content was filtered.
	Detected *bool

	// REQUIRED; A value indicating whether or not the content has been filtered.
	Filtered *bool

	// The license description associated with the detection.
	License *string

	// The internet location associated with the detection.
	URL *string
}

ContentFilterCitedDetectionResult - Represents the outcome of a detection operation against protected resources as performed by content filtering.

func (ContentFilterCitedDetectionResult) MarshalJSON

func (c ContentFilterCitedDetectionResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ContentFilterCitedDetectionResult.

func (*ContentFilterCitedDetectionResult) UnmarshalJSON

func (c *ContentFilterCitedDetectionResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ContentFilterCitedDetectionResult.

type ContentFilterDetailedResults

type ContentFilterDetailedResults struct {
	// REQUIRED; The collection of detailed blocklist result information.
	Details []ContentFilterBlocklistIDResult

	// REQUIRED; A value indicating whether or not the content has been filtered.
	Filtered *bool
}

ContentFilterDetailedResults - Represents a structured collection of result details for content filtering.

func (ContentFilterDetailedResults) MarshalJSON

func (c ContentFilterDetailedResults) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ContentFilterDetailedResults.

func (*ContentFilterDetailedResults) UnmarshalJSON

func (c *ContentFilterDetailedResults) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ContentFilterDetailedResults.

type ContentFilterDetectionResult

type ContentFilterDetectionResult struct {
	// REQUIRED; A value indicating whether detection occurred, irrespective of severity or whether the content was filtered.
	Detected *bool

	// REQUIRED; A value indicating whether or not the content has been filtered.
	Filtered *bool
}

ContentFilterDetectionResult - Represents the outcome of a detection operation performed by content filtering.

func (ContentFilterDetectionResult) MarshalJSON

func (c ContentFilterDetectionResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ContentFilterDetectionResult.

func (*ContentFilterDetectionResult) UnmarshalJSON

func (c *ContentFilterDetectionResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ContentFilterDetectionResult.

type ContentFilterError

type ContentFilterError struct {
	OpenAIError *openai.Error
	ContentFilterResultDetailsForPrompt
}

ContentFilterError can be extracted from an openai.Error using ExtractContentFilterError.

func (*ContentFilterError) Error

func (c *ContentFilterError) Error() string

Error implements the error interface for type ContentFilterError.

func (*ContentFilterError) NonRetriable

func (c *ContentFilterError) NonRetriable()

NonRetriable is a marker method, indicating the request failure is terminal.

func (*ContentFilterError) Unwrap

func (c *ContentFilterError) Unwrap() error

Unwrap returns the inner error for this error.

type ContentFilterResult

type ContentFilterResult struct {
	// REQUIRED; A value indicating whether or not the content has been filtered.
	Filtered *bool

	// REQUIRED; Ratings for the intensity and risk level of filtered content.
	Severity *ContentFilterSeverity
}

ContentFilterResult - Information about filtered content severity level and if it has been filtered or not.

func (ContentFilterResult) MarshalJSON

func (c ContentFilterResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ContentFilterResult.

func (*ContentFilterResult) UnmarshalJSON

func (c *ContentFilterResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ContentFilterResult.

type ContentFilterResultDetailsForPrompt

type ContentFilterResultDetailsForPrompt struct {
	// Describes detection results against configured custom blocklists.
	CustomBlocklists *ContentFilterDetailedResults

	// Describes an error returned if the content filtering system is down or otherwise unable to complete the operation in time.
	Error *Error

	// Describes language attacks or uses that include pejorative or discriminatory language with reference to a person or identity
	// group on the basis of certain differentiating attributes of these groups
	// including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, religion,
	// immigration status, ability status, personal appearance, and body size.
	Hate *ContentFilterResult

	// Whether an indirect attack was detected in the prompt.
	IndirectAttack *ContentFilterDetectionResult

	// Whether a jailbreak attempt was detected in the prompt.
	Jailbreak *ContentFilterDetectionResult

	// Describes whether profanity was detected.
	Profanity *ContentFilterDetectionResult

	// Describes language related to physical actions intended to purposely hurt, injure, or damage one’s body, or kill oneself.
	SelfHarm *ContentFilterResult

	// Describes language related to anatomical organs and genitals, romantic relationships, acts portrayed in erotic or affectionate
	// terms, physical sexual acts, including those portrayed as an assault or a
	// forced sexual violent act against one’s will, prostitution, pornography, and abuse.
	Sexual *ContentFilterResult

	// Describes language related to physical actions intended to hurt, injure, damage, or kill someone or something; describes
	// weapons, etc.
	Violence *ContentFilterResult
}

ContentFilterResultDetailsForPrompt - Information about content filtering evaluated against input data to Azure OpenAI.

func (ContentFilterResultDetailsForPrompt) MarshalJSON

func (c ContentFilterResultDetailsForPrompt) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ContentFilterResultDetailsForPrompt.

func (*ContentFilterResultDetailsForPrompt) UnmarshalJSON

func (c *ContentFilterResultDetailsForPrompt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ContentFilterResultDetailsForPrompt.

type ContentFilterResultsForChoice

type ContentFilterResultsForChoice struct {
	// Describes detection results against configured custom blocklists.
	CustomBlocklists *ContentFilterDetailedResults

	// Describes an error returned if the content filtering system is down or otherwise unable to complete the operation in time.
	Error *Error

	// Describes language attacks or uses that include pejorative or discriminatory language with reference to a person or identity
	// group on the basis of certain differentiating attributes of these groups
	// including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, religion,
	// immigration status, ability status, personal appearance, and body size.
	Hate *ContentFilterResult

	// Describes whether profanity was detected.
	Profanity *ContentFilterDetectionResult

	// Information about detection of protected code material.
	ProtectedMaterialCode *ContentFilterCitedDetectionResult

	// Information about detection of protected text material.
	ProtectedMaterialText *ContentFilterDetectionResult

	// Describes language related to physical actions intended to purposely hurt, injure, or damage one’s body, or kill oneself.
	SelfHarm *ContentFilterResult

	// Describes language related to anatomical organs and genitals, romantic relationships, acts portrayed in erotic or affectionate
	// terms, physical sexual acts, including those portrayed as an assault or a
	// forced sexual violent act against one’s will, prostitution, pornography, and abuse.
	Sexual *ContentFilterResult

	// Describes language related to physical actions intended to hurt, injure, damage, or kill someone or something; describes
	// weapons, etc.
	Violence *ContentFilterResult
}

ContentFilterResultsForChoice - Information about content filtering evaluated against generated model output.

func (ContentFilterResultsForChoice) MarshalJSON

func (c ContentFilterResultsForChoice) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ContentFilterResultsForChoice.

func (*ContentFilterResultsForChoice) UnmarshalJSON

func (c *ContentFilterResultsForChoice) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ContentFilterResultsForChoice.

type ContentFilterResultsForPrompt

type ContentFilterResultsForPrompt struct {
	// REQUIRED; Content filtering results for this prompt
	ContentFilterResults *ContentFilterResultDetailsForPrompt

	// REQUIRED; The index of this prompt in the set of prompt results
	PromptIndex *int32
}

ContentFilterResultsForPrompt - Content filtering results for a single prompt in the request.

func (ContentFilterResultsForPrompt) MarshalJSON

func (c ContentFilterResultsForPrompt) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ContentFilterResultsForPrompt.

func (*ContentFilterResultsForPrompt) UnmarshalJSON

func (c *ContentFilterResultsForPrompt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ContentFilterResultsForPrompt.

type ContentFilterSeverity

type ContentFilterSeverity string

ContentFilterSeverity - Ratings for the intensity and risk level of harmful content.

const (
	// ContentFilterSeverityHigh - Content that displays explicit and severe harmful instructions, actions,
	// damage, or abuse; includes endorsement, glorification, or promotion of severe
	// harmful acts, extreme or illegal forms of harm, radicalization, or non-consensual
	// power exchange or abuse.
	ContentFilterSeverityHigh ContentFilterSeverity = "high"
	// ContentFilterSeverityLow - Content that expresses prejudiced, judgmental, or opinionated views, includes offensive
	// use of language, stereotyping, use cases exploring a fictional world (for example, gaming,
	// literature) and depictions at low intensity.
	ContentFilterSeverityLow ContentFilterSeverity = "low"
	// ContentFilterSeverityMedium - Content that uses offensive, insulting, mocking, intimidating, or demeaning language
	// towards specific identity groups, includes depictions of seeking and executing harmful
	// instructions, fantasies, glorification, promotion of harm at medium intensity.
	ContentFilterSeverityMedium ContentFilterSeverity = "medium"
	// ContentFilterSeveritySafe - Content may be related to violence, self-harm, sexual, or hate categories but the terms
	// are used in general, journalistic, scientific, medical, and similar professional contexts,
	// which are appropriate for most audiences.
	ContentFilterSeveritySafe ContentFilterSeverity = "safe"
)

func PossibleContentFilterSeverityValues

func PossibleContentFilterSeverityValues() []ContentFilterSeverity

PossibleContentFilterSeverityValues returns the possible values for the ContentFilterSeverity const type.

type ElasticsearchChatExtensionConfiguration

type ElasticsearchChatExtensionConfiguration struct {
	// REQUIRED; The parameters to use when configuring Elasticsearch®.
	Parameters *ElasticsearchChatExtensionParameters

	// REQUIRED; The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. Azure
	// chat extensions are only compatible with Azure OpenAI.
	Type *AzureChatExtensionType
}

ElasticsearchChatExtensionConfiguration - A specific representation of configurable options for Elasticsearch when using it as an Azure OpenAI chat extension.

func (*ElasticsearchChatExtensionConfiguration) GetAzureChatExtensionConfiguration

func (e *ElasticsearchChatExtensionConfiguration) GetAzureChatExtensionConfiguration() *AzureChatExtensionConfiguration

GetAzureChatExtensionConfiguration implements the AzureChatExtensionConfigurationClassification interface for type ElasticsearchChatExtensionConfiguration.

func (ElasticsearchChatExtensionConfiguration) MarshalJSON

func (e ElasticsearchChatExtensionConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ElasticsearchChatExtensionConfiguration.

func (*ElasticsearchChatExtensionConfiguration) UnmarshalJSON

func (e *ElasticsearchChatExtensionConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ElasticsearchChatExtensionConfiguration.

type ElasticsearchChatExtensionParameters

type ElasticsearchChatExtensionParameters struct {
	// REQUIRED; The endpoint of Elasticsearch®.
	Endpoint *string

	// REQUIRED; The index name of Elasticsearch®.
	IndexName *string

	// If specified as true, the system will allow partial search results to be used and the request fails if all the queries
	// fail. If not specified, or specified as false, the request will fail if any
	// search query fails.
	AllowPartialResult *bool

	// The authentication method to use when accessing the defined data source. Each data source type supports a specific set
	// of available authentication methods; please see the documentation of the data
	// source for supported mechanisms. If not otherwise provided, On Your Data will attempt to use System Managed Identity (default
	// credential) authentication.
	Authentication OnYourDataAuthenticationOptionsClassification

	// The embedding dependency for vector search.
	EmbeddingDependency OnYourDataVectorizationSourceClassification

	// The index field mapping options of Elasticsearch®.
	FieldsMapping *ElasticsearchIndexFieldMappingOptions

	// Whether queries should be restricted to use of indexed data.
	InScope *bool

	// The included properties of the output context. If not specified, the default value is citations and intent.
	IncludeContexts []OnYourDataContextProperty

	// The max number of rewritten queries should be send to search provider for one user message. If not specified, the system
	// will decide the number of queries to send.
	MaxSearchQueries *int32

	// The query type of Elasticsearch®.
	QueryType *ElasticsearchQueryType

	// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but
	// lower recall of the answer.
	Strictness *int32

	// The configured top number of documents to feature for the configured query.
	TopNDocuments *int32
}

ElasticsearchChatExtensionParameters - Parameters to use when configuring Elasticsearch® as an Azure OpenAI chat extension. The supported authentication types are KeyAndKeyId and EncodedAPIKey.

func (ElasticsearchChatExtensionParameters) MarshalJSON

func (e ElasticsearchChatExtensionParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ElasticsearchChatExtensionParameters.

func (*ElasticsearchChatExtensionParameters) UnmarshalJSON

func (e *ElasticsearchChatExtensionParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ElasticsearchChatExtensionParameters.

type ElasticsearchIndexFieldMappingOptions

type ElasticsearchIndexFieldMappingOptions struct {
	// The names of index fields that should be treated as content.
	ContentFields []string

	// The separator pattern that content fields should use.
	ContentFieldsSeparator *string

	// The name of the index field to use as a filepath.
	FilepathField *string

	// The name of the index field to use as a title.
	TitleField *string

	// The name of the index field to use as a URL.
	URLField *string

	// The names of fields that represent vector data.
	VectorFields []string
}

ElasticsearchIndexFieldMappingOptions - Optional settings to control how fields are processed when using a configured Elasticsearch® resource.

func (ElasticsearchIndexFieldMappingOptions) MarshalJSON

func (e ElasticsearchIndexFieldMappingOptions) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ElasticsearchIndexFieldMappingOptions.

func (*ElasticsearchIndexFieldMappingOptions) UnmarshalJSON

func (e *ElasticsearchIndexFieldMappingOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ElasticsearchIndexFieldMappingOptions.

type ElasticsearchQueryType

type ElasticsearchQueryType string

ElasticsearchQueryType - The type of Elasticsearch® retrieval query that should be executed when using it as an Azure OpenAI chat extension.

const (
	// ElasticsearchQueryTypeSimple - Represents the default, simple query parser.
	ElasticsearchQueryTypeSimple ElasticsearchQueryType = "simple"
	// ElasticsearchQueryTypeVector - Represents vector search over computed data.
	ElasticsearchQueryTypeVector ElasticsearchQueryType = "vector"
)

func PossibleElasticsearchQueryTypeValues

func PossibleElasticsearchQueryTypeValues() []ElasticsearchQueryType

PossibleElasticsearchQueryTypeValues returns the possible values for the ElasticsearchQueryType const type.

type Error

type Error struct {
	// REQUIRED; One of a server-defined set of error codes.
	Code *string

	// REQUIRED; A human-readable representation of the error.
	Message *string
}

Error - The error object.

func (Error) MarshalJSON

func (e Error) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Error.

func (*Error) UnmarshalJSON

func (e *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Error.

type MongoDBChatExtensionConfiguration

type MongoDBChatExtensionConfiguration struct {
	// REQUIRED; The parameters for the MongoDB chat extension.
	Parameters *MongoDBChatExtensionParameters

	// REQUIRED; The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. Azure
	// chat extensions are only compatible with Azure OpenAI.
	Type *AzureChatExtensionType
}

MongoDBChatExtensionConfiguration - A specific representation of configurable options for a MongoDB chat extension configuration.

func (*MongoDBChatExtensionConfiguration) GetAzureChatExtensionConfiguration

func (m *MongoDBChatExtensionConfiguration) GetAzureChatExtensionConfiguration() *AzureChatExtensionConfiguration

GetAzureChatExtensionConfiguration implements the AzureChatExtensionConfigurationClassification interface for type MongoDBChatExtensionConfiguration.

func (MongoDBChatExtensionConfiguration) MarshalJSON

func (m MongoDBChatExtensionConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MongoDBChatExtensionConfiguration.

func (*MongoDBChatExtensionConfiguration) UnmarshalJSON

func (m *MongoDBChatExtensionConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBChatExtensionConfiguration.

type MongoDBChatExtensionParameters

type MongoDBChatExtensionParameters struct {
	// REQUIRED; The app name for MongoDB.
	AppName *string

	// REQUIRED; The collection name for MongoDB.
	CollectionName *string

	// REQUIRED; The database name for MongoDB.
	DatabaseName *string

	// REQUIRED; The vectorization source to use with the MongoDB chat extension.
	EmbeddingDependency *MongoDBChatExtensionParametersEmbeddingDependency

	// REQUIRED; The endpoint name for MongoDB.
	Endpoint *string

	// REQUIRED; Field mappings to apply to data used by the MongoDB data source. Note that content and vector field mappings
	// are required for MongoDB.
	FieldsMapping *MongoDBChatExtensionParametersFieldsMapping

	// REQUIRED; The name of the MongoDB index.
	IndexName *string

	// If specified as true, the system will allow partial search results to be used and the request fails if all the queries
	// fail. If not specified, or specified as false, the request will fail if any
	// search query fails.
	AllowPartialResult *bool

	// The authentication method to use when accessing the defined data source. Each data source type supports a specific set
	// of available authentication methods; please see the documentation of the data
	// source for supported mechanisms. If not otherwise provided, On Your Data will attempt to use System Managed Identity (default
	// credential) authentication.
	Authentication OnYourDataAuthenticationOptionsClassification

	// Whether queries should be restricted to use of indexed data.
	InScope *bool

	// The included properties of the output context. If not specified, the default value is citations and intent.
	IncludeContexts []OnYourDataContextProperty

	// The max number of rewritten queries should be send to search provider for one user message. If not specified, the system
	// will decide the number of queries to send.
	MaxSearchQueries *int32

	// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but
	// lower recall of the answer.
	Strictness *int32

	// The configured top number of documents to feature for the configured query.
	TopNDocuments *int32
}

MongoDBChatExtensionParameters - Parameters for the MongoDB chat extension. The supported authentication types are AccessToken, SystemAssignedManagedIdentity and UserAssignedManagedIdentity.

func (MongoDBChatExtensionParameters) MarshalJSON

func (m MongoDBChatExtensionParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MongoDBChatExtensionParameters.

func (*MongoDBChatExtensionParameters) UnmarshalJSON

func (m *MongoDBChatExtensionParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBChatExtensionParameters.

type MongoDBChatExtensionParametersEmbeddingDependency

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

MongoDBChatExtensionParametersEmbeddingDependency contains the embedding dependency for the MongoDBChatExtensionParameters. NOTE: This should be created using [azopenai.NewMongoDBChatExtensionParametersEmbeddingDependency]

func NewMongoDBChatExtensionParametersEmbeddingDependency

NewMongoDBChatExtensionParametersEmbeddingDependency creates a [azopenai.MongoDBChatExtensionParametersEmbeddingDependency].

func (MongoDBChatExtensionParametersEmbeddingDependency) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type MongoDBChatExtensionParametersEmbeddingDependency.

type MongoDBChatExtensionParametersFieldsMapping

type MongoDBChatExtensionParametersFieldsMapping struct {
	// REQUIRED
	ContentFields []string

	// REQUIRED
	VectorFields           []string
	ContentFieldsSeparator *string
	FilepathField          *string
	TitleField             *string
	URLField               *string
}

MongoDBChatExtensionParametersFieldsMapping - Field mappings to apply to data used by the MongoDB data source. Note that content and vector field mappings are required for MongoDB.

func (MongoDBChatExtensionParametersFieldsMapping) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type MongoDBChatExtensionParametersFieldsMapping.

func (*MongoDBChatExtensionParametersFieldsMapping) UnmarshalJSON

func (m *MongoDBChatExtensionParametersFieldsMapping) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBChatExtensionParametersFieldsMapping.

type OnYourDataAPIKeyAuthenticationOptions

type OnYourDataAPIKeyAuthenticationOptions struct {
	// REQUIRED; The API key to use for authentication.
	Key *string

	// REQUIRED; The authentication type.
	Type *OnYourDataAuthenticationType
}

OnYourDataAPIKeyAuthenticationOptions - The authentication options for Azure OpenAI On Your Data when using an API key.

func (*OnYourDataAPIKeyAuthenticationOptions) GetOnYourDataAuthenticationOptions

func (o *OnYourDataAPIKeyAuthenticationOptions) GetOnYourDataAuthenticationOptions() *OnYourDataAuthenticationOptions

GetOnYourDataAuthenticationOptions implements the OnYourDataAuthenticationOptionsClassification interface for type OnYourDataAPIKeyAuthenticationOptions.

func (OnYourDataAPIKeyAuthenticationOptions) MarshalJSON

func (o OnYourDataAPIKeyAuthenticationOptions) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OnYourDataAPIKeyAuthenticationOptions.

func (*OnYourDataAPIKeyAuthenticationOptions) UnmarshalJSON

func (o *OnYourDataAPIKeyAuthenticationOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataAPIKeyAuthenticationOptions.

type OnYourDataAccessTokenAuthenticationOptions

type OnYourDataAccessTokenAuthenticationOptions struct {
	// REQUIRED; The access token to use for authentication.
	AccessToken *string

	// REQUIRED; The authentication type.
	Type *OnYourDataAuthenticationType
}

OnYourDataAccessTokenAuthenticationOptions - The authentication options for Azure OpenAI On Your Data when using access token.

func (*OnYourDataAccessTokenAuthenticationOptions) GetOnYourDataAuthenticationOptions

func (o *OnYourDataAccessTokenAuthenticationOptions) GetOnYourDataAuthenticationOptions() *OnYourDataAuthenticationOptions

GetOnYourDataAuthenticationOptions implements the OnYourDataAuthenticationOptionsClassification interface for type OnYourDataAccessTokenAuthenticationOptions.

func (OnYourDataAccessTokenAuthenticationOptions) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type OnYourDataAccessTokenAuthenticationOptions.

func (*OnYourDataAccessTokenAuthenticationOptions) UnmarshalJSON

func (o *OnYourDataAccessTokenAuthenticationOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataAccessTokenAuthenticationOptions.

type OnYourDataAuthenticationOptions

type OnYourDataAuthenticationOptions struct {
	// REQUIRED; The authentication type.
	Type *OnYourDataAuthenticationType
}

OnYourDataAuthenticationOptions - The authentication options for Azure OpenAI On Your Data.

func (*OnYourDataAuthenticationOptions) GetOnYourDataAuthenticationOptions

func (o *OnYourDataAuthenticationOptions) GetOnYourDataAuthenticationOptions() *OnYourDataAuthenticationOptions

GetOnYourDataAuthenticationOptions implements the OnYourDataAuthenticationOptionsClassification interface for type OnYourDataAuthenticationOptions.

func (OnYourDataAuthenticationOptions) MarshalJSON

func (o OnYourDataAuthenticationOptions) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OnYourDataAuthenticationOptions.

func (*OnYourDataAuthenticationOptions) UnmarshalJSON

func (o *OnYourDataAuthenticationOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataAuthenticationOptions.

type OnYourDataAuthenticationOptionsClassification

type OnYourDataAuthenticationOptionsClassification interface {
	// GetOnYourDataAuthenticationOptions returns the OnYourDataAuthenticationOptions content of the underlying type.
	GetOnYourDataAuthenticationOptions() *OnYourDataAuthenticationOptions
}

OnYourDataAuthenticationOptionsClassification provides polymorphic access to related types. Call the interface's GetOnYourDataAuthenticationOptions() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *OnYourDataAPIKeyAuthenticationOptions, *OnYourDataAccessTokenAuthenticationOptions, *OnYourDataAuthenticationOptions, - *OnYourDataConnectionStringAuthenticationOptions, *OnYourDataEncodedAPIKeyAuthenticationOptions, *OnYourDataKeyAndKeyIDAuthenticationOptions, - *OnYourDataSystemAssignedManagedIdentityAuthenticationOptions, *OnYourDataUserAssignedManagedIdentityAuthenticationOptions, - *OnYourDataUsernameAndPasswordAuthenticationOptions

type OnYourDataAuthenticationType

type OnYourDataAuthenticationType string

OnYourDataAuthenticationType - The authentication types supported with Azure OpenAI On Your Data.

const (
	// OnYourDataAuthenticationTypeAPIKey - Authentication via API key.
	OnYourDataAuthenticationTypeAPIKey OnYourDataAuthenticationType = "api_key"
	// OnYourDataAuthenticationTypeAccessToken - Authentication via access token.
	OnYourDataAuthenticationTypeAccessToken OnYourDataAuthenticationType = "access_token"
	// OnYourDataAuthenticationTypeConnectionString - Authentication via connection string.
	OnYourDataAuthenticationTypeConnectionString OnYourDataAuthenticationType = "connection_string"
	// OnYourDataAuthenticationTypeEncodedAPIKey - Authentication via encoded API key.
	OnYourDataAuthenticationTypeEncodedAPIKey OnYourDataAuthenticationType = "encoded_api_key"
	// OnYourDataAuthenticationTypeKeyAndKeyID - Authentication via key and key ID pair.
	OnYourDataAuthenticationTypeKeyAndKeyID OnYourDataAuthenticationType = "key_and_key_id"
	// OnYourDataAuthenticationTypeSystemAssignedManagedIdentity - Authentication via system-assigned managed identity.
	OnYourDataAuthenticationTypeSystemAssignedManagedIdentity OnYourDataAuthenticationType = "system_assigned_managed_identity"
	// OnYourDataAuthenticationTypeUserAssignedManagedIdentity - Authentication via user-assigned managed identity.
	OnYourDataAuthenticationTypeUserAssignedManagedIdentity OnYourDataAuthenticationType = "user_assigned_managed_identity"
	// OnYourDataAuthenticationTypeUsernameAndPassword - Authentication via username and password.
	OnYourDataAuthenticationTypeUsernameAndPassword OnYourDataAuthenticationType = "username_and_password"
)

func PossibleOnYourDataAuthenticationTypeValues

func PossibleOnYourDataAuthenticationTypeValues() []OnYourDataAuthenticationType

PossibleOnYourDataAuthenticationTypeValues returns the possible values for the OnYourDataAuthenticationType const type.

type OnYourDataConnectionStringAuthenticationOptions

type OnYourDataConnectionStringAuthenticationOptions struct {
	// REQUIRED; The connection string to use for authentication.
	ConnectionString *string

	// REQUIRED; The authentication type.
	Type *OnYourDataAuthenticationType
}

OnYourDataConnectionStringAuthenticationOptions - The authentication options for Azure OpenAI On Your Data when using a connection string.

func (*OnYourDataConnectionStringAuthenticationOptions) GetOnYourDataAuthenticationOptions

GetOnYourDataAuthenticationOptions implements the OnYourDataAuthenticationOptionsClassification interface for type OnYourDataConnectionStringAuthenticationOptions.

func (OnYourDataConnectionStringAuthenticationOptions) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type OnYourDataConnectionStringAuthenticationOptions.

func (*OnYourDataConnectionStringAuthenticationOptions) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataConnectionStringAuthenticationOptions.

type OnYourDataContextProperty

type OnYourDataContextProperty string

OnYourDataContextProperty - The context property.

const (
	// OnYourDataContextPropertyAllRetrievedDocuments - The `all_retrieved_documents` property.
	OnYourDataContextPropertyAllRetrievedDocuments OnYourDataContextProperty = "all_retrieved_documents"
	// OnYourDataContextPropertyCitations - The `citations` property.
	OnYourDataContextPropertyCitations OnYourDataContextProperty = "citations"
	// OnYourDataContextPropertyIntent - The `intent` property.
	OnYourDataContextPropertyIntent OnYourDataContextProperty = "intent"
)

func PossibleOnYourDataContextPropertyValues

func PossibleOnYourDataContextPropertyValues() []OnYourDataContextProperty

PossibleOnYourDataContextPropertyValues returns the possible values for the OnYourDataContextProperty const type.

type OnYourDataDeploymentNameVectorizationSource

type OnYourDataDeploymentNameVectorizationSource struct {
	// REQUIRED; The embedding model deployment name within the same Azure OpenAI resource. This enables you to use vector search
	// without Azure OpenAI api-key and without Azure OpenAI public network access.
	DeploymentName *string

	// REQUIRED; The type of vectorization source to use.
	Type *OnYourDataVectorizationSourceType

	// The number of dimensions the embeddings should have. Only supported in text-embedding-3 and later models.
	Dimensions *int32
}

OnYourDataDeploymentNameVectorizationSource - The details of a a vectorization source, used by Azure OpenAI On Your Data when applying vector search, that is based on an internal embeddings model deployment name in the same Azure OpenAI resource.

func (*OnYourDataDeploymentNameVectorizationSource) GetOnYourDataVectorizationSource

func (o *OnYourDataDeploymentNameVectorizationSource) GetOnYourDataVectorizationSource() *OnYourDataVectorizationSource

GetOnYourDataVectorizationSource implements the OnYourDataVectorizationSourceClassification interface for type OnYourDataDeploymentNameVectorizationSource.

func (OnYourDataDeploymentNameVectorizationSource) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type OnYourDataDeploymentNameVectorizationSource.

func (*OnYourDataDeploymentNameVectorizationSource) UnmarshalJSON

func (o *OnYourDataDeploymentNameVectorizationSource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataDeploymentNameVectorizationSource.

type OnYourDataEncodedAPIKeyAuthenticationOptions

type OnYourDataEncodedAPIKeyAuthenticationOptions struct {
	// REQUIRED; The encoded API key to use for authentication.
	EncodedAPIKey *string

	// REQUIRED; The authentication type.
	Type *OnYourDataAuthenticationType
}

OnYourDataEncodedAPIKeyAuthenticationOptions - The authentication options for Azure OpenAI On Your Data when using an Elasticsearch encoded API key.

func (*OnYourDataEncodedAPIKeyAuthenticationOptions) GetOnYourDataAuthenticationOptions

func (o *OnYourDataEncodedAPIKeyAuthenticationOptions) GetOnYourDataAuthenticationOptions() *OnYourDataAuthenticationOptions

GetOnYourDataAuthenticationOptions implements the OnYourDataAuthenticationOptionsClassification interface for type OnYourDataEncodedAPIKeyAuthenticationOptions.

func (OnYourDataEncodedAPIKeyAuthenticationOptions) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type OnYourDataEncodedAPIKeyAuthenticationOptions.

func (*OnYourDataEncodedAPIKeyAuthenticationOptions) UnmarshalJSON

func (o *OnYourDataEncodedAPIKeyAuthenticationOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataEncodedAPIKeyAuthenticationOptions.

type OnYourDataEndpointVectorizationSource

type OnYourDataEndpointVectorizationSource struct {
	// REQUIRED; Specifies the authentication options to use when retrieving embeddings from the specified endpoint.
	Authentication OnYourDataVectorSearchAuthenticationOptionsClassification

	// REQUIRED; Specifies the resource endpoint URL from which embeddings should be retrieved. It should be in the format of
	// https://YOURRESOURCENAME.openai.azure.com/openai/deployments/YOURDEPLOYMENTNAME/embeddings.
	// The api-version query parameter is not allowed.
	Endpoint *string

	// REQUIRED; The type of vectorization source to use.
	Type *OnYourDataVectorizationSourceType
}

OnYourDataEndpointVectorizationSource - The details of a a vectorization source, used by Azure OpenAI On Your Data when applying vector search, that is based on a public Azure OpenAI endpoint call for embeddings.

func (*OnYourDataEndpointVectorizationSource) GetOnYourDataVectorizationSource

func (o *OnYourDataEndpointVectorizationSource) GetOnYourDataVectorizationSource() *OnYourDataVectorizationSource

GetOnYourDataVectorizationSource implements the OnYourDataVectorizationSourceClassification interface for type OnYourDataEndpointVectorizationSource.

func (OnYourDataEndpointVectorizationSource) MarshalJSON

func (o OnYourDataEndpointVectorizationSource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OnYourDataEndpointVectorizationSource.

func (*OnYourDataEndpointVectorizationSource) UnmarshalJSON

func (o *OnYourDataEndpointVectorizationSource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataEndpointVectorizationSource.

type OnYourDataIntegratedVectorizationSource

type OnYourDataIntegratedVectorizationSource struct {
	// REQUIRED; The type of vectorization source to use.
	Type *OnYourDataVectorizationSourceType
}

OnYourDataIntegratedVectorizationSource - Represents the integrated vectorizer defined within the search resource.

func (*OnYourDataIntegratedVectorizationSource) GetOnYourDataVectorizationSource

func (o *OnYourDataIntegratedVectorizationSource) GetOnYourDataVectorizationSource() *OnYourDataVectorizationSource

GetOnYourDataVectorizationSource implements the OnYourDataVectorizationSourceClassification interface for type OnYourDataIntegratedVectorizationSource.

func (OnYourDataIntegratedVectorizationSource) MarshalJSON

func (o OnYourDataIntegratedVectorizationSource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OnYourDataIntegratedVectorizationSource.

func (*OnYourDataIntegratedVectorizationSource) UnmarshalJSON

func (o *OnYourDataIntegratedVectorizationSource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataIntegratedVectorizationSource.

type OnYourDataKeyAndKeyIDAuthenticationOptions

type OnYourDataKeyAndKeyIDAuthenticationOptions struct {
	// REQUIRED; The key to use for authentication.
	Key *string

	// REQUIRED; The key ID to use for authentication.
	KeyID *string

	// REQUIRED; The authentication type.
	Type *OnYourDataAuthenticationType
}

OnYourDataKeyAndKeyIDAuthenticationOptions - The authentication options for Azure OpenAI On Your Data when using an Elasticsearch key and key ID pair.

func (*OnYourDataKeyAndKeyIDAuthenticationOptions) GetOnYourDataAuthenticationOptions

func (o *OnYourDataKeyAndKeyIDAuthenticationOptions) GetOnYourDataAuthenticationOptions() *OnYourDataAuthenticationOptions

GetOnYourDataAuthenticationOptions implements the OnYourDataAuthenticationOptionsClassification interface for type OnYourDataKeyAndKeyIDAuthenticationOptions.

func (OnYourDataKeyAndKeyIDAuthenticationOptions) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type OnYourDataKeyAndKeyIDAuthenticationOptions.

func (*OnYourDataKeyAndKeyIDAuthenticationOptions) UnmarshalJSON

func (o *OnYourDataKeyAndKeyIDAuthenticationOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataKeyAndKeyIDAuthenticationOptions.

type OnYourDataModelIDVectorizationSource

type OnYourDataModelIDVectorizationSource struct {
	// REQUIRED; The embedding model ID build inside the search service. Currently only supported by Elasticsearch®.
	ModelID *string

	// REQUIRED; The type of vectorization source to use.
	Type *OnYourDataVectorizationSourceType
}

OnYourDataModelIDVectorizationSource - The details of a a vectorization source, used by Azure OpenAI On Your Data when applying vector search, that is based on a search service model ID. Currently only supported by Elasticsearch®.

func (*OnYourDataModelIDVectorizationSource) GetOnYourDataVectorizationSource

func (o *OnYourDataModelIDVectorizationSource) GetOnYourDataVectorizationSource() *OnYourDataVectorizationSource

GetOnYourDataVectorizationSource implements the OnYourDataVectorizationSourceClassification interface for type OnYourDataModelIDVectorizationSource.

func (OnYourDataModelIDVectorizationSource) MarshalJSON

func (o OnYourDataModelIDVectorizationSource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OnYourDataModelIDVectorizationSource.

func (*OnYourDataModelIDVectorizationSource) UnmarshalJSON

func (o *OnYourDataModelIDVectorizationSource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataModelIDVectorizationSource.

type OnYourDataSystemAssignedManagedIdentityAuthenticationOptions

type OnYourDataSystemAssignedManagedIdentityAuthenticationOptions struct {
	// REQUIRED; The authentication type.
	Type *OnYourDataAuthenticationType
}

OnYourDataSystemAssignedManagedIdentityAuthenticationOptions - The authentication options for Azure OpenAI On Your Data when using a system-assigned managed identity.

func (*OnYourDataSystemAssignedManagedIdentityAuthenticationOptions) GetOnYourDataAuthenticationOptions

GetOnYourDataAuthenticationOptions implements the OnYourDataAuthenticationOptionsClassification interface for type OnYourDataSystemAssignedManagedIdentityAuthenticationOptions.

func (OnYourDataSystemAssignedManagedIdentityAuthenticationOptions) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type OnYourDataSystemAssignedManagedIdentityAuthenticationOptions.

func (*OnYourDataSystemAssignedManagedIdentityAuthenticationOptions) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataSystemAssignedManagedIdentityAuthenticationOptions.

type OnYourDataUserAssignedManagedIdentityAuthenticationOptions

type OnYourDataUserAssignedManagedIdentityAuthenticationOptions struct {
	// REQUIRED; The resource ID of the user-assigned managed identity to use for authentication.
	ManagedIdentityResourceID *string

	// REQUIRED; The authentication type.
	Type *OnYourDataAuthenticationType
}

OnYourDataUserAssignedManagedIdentityAuthenticationOptions - The authentication options for Azure OpenAI On Your Data when using a user-assigned managed identity.

func (*OnYourDataUserAssignedManagedIdentityAuthenticationOptions) GetOnYourDataAuthenticationOptions

GetOnYourDataAuthenticationOptions implements the OnYourDataAuthenticationOptionsClassification interface for type OnYourDataUserAssignedManagedIdentityAuthenticationOptions.

func (OnYourDataUserAssignedManagedIdentityAuthenticationOptions) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type OnYourDataUserAssignedManagedIdentityAuthenticationOptions.

func (*OnYourDataUserAssignedManagedIdentityAuthenticationOptions) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataUserAssignedManagedIdentityAuthenticationOptions.

type OnYourDataUsernameAndPasswordAuthenticationOptions

type OnYourDataUsernameAndPasswordAuthenticationOptions struct {
	// REQUIRED; The password.
	Password *string

	// REQUIRED; The authentication type.
	Type *OnYourDataAuthenticationType

	// REQUIRED; The username.
	Username *string
}

OnYourDataUsernameAndPasswordAuthenticationOptions - The authentication options for Azure OpenAI On Your Data when using a username and password.

func (*OnYourDataUsernameAndPasswordAuthenticationOptions) GetOnYourDataAuthenticationOptions

GetOnYourDataAuthenticationOptions implements the OnYourDataAuthenticationOptionsClassification interface for type OnYourDataUsernameAndPasswordAuthenticationOptions.

func (OnYourDataUsernameAndPasswordAuthenticationOptions) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type OnYourDataUsernameAndPasswordAuthenticationOptions.

func (*OnYourDataUsernameAndPasswordAuthenticationOptions) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataUsernameAndPasswordAuthenticationOptions.

type OnYourDataVectorSearchAPIKeyAuthenticationOptions

type OnYourDataVectorSearchAPIKeyAuthenticationOptions struct {
	// REQUIRED; The API key to use for authentication.
	Key *string

	// REQUIRED; The type of authentication to use.
	Type *OnYourDataVectorSearchAuthenticationType
}

OnYourDataVectorSearchAPIKeyAuthenticationOptions - The authentication options for Azure OpenAI On Your Data when using an API key.

func (*OnYourDataVectorSearchAPIKeyAuthenticationOptions) GetOnYourDataVectorSearchAuthenticationOptions

func (o *OnYourDataVectorSearchAPIKeyAuthenticationOptions) GetOnYourDataVectorSearchAuthenticationOptions() *OnYourDataVectorSearchAuthenticationOptions

GetOnYourDataVectorSearchAuthenticationOptions implements the OnYourDataVectorSearchAuthenticationOptionsClassification interface for type OnYourDataVectorSearchAPIKeyAuthenticationOptions.

func (OnYourDataVectorSearchAPIKeyAuthenticationOptions) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type OnYourDataVectorSearchAPIKeyAuthenticationOptions.

func (*OnYourDataVectorSearchAPIKeyAuthenticationOptions) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataVectorSearchAPIKeyAuthenticationOptions.

type OnYourDataVectorSearchAccessTokenAuthenticationOptions

type OnYourDataVectorSearchAccessTokenAuthenticationOptions struct {
	// REQUIRED; The access token to use for authentication.
	AccessToken *string

	// REQUIRED; The type of authentication to use.
	Type *OnYourDataVectorSearchAuthenticationType
}

OnYourDataVectorSearchAccessTokenAuthenticationOptions - The authentication options for Azure OpenAI On Your Data vector search when using access token.

func (*OnYourDataVectorSearchAccessTokenAuthenticationOptions) GetOnYourDataVectorSearchAuthenticationOptions

GetOnYourDataVectorSearchAuthenticationOptions implements the OnYourDataVectorSearchAuthenticationOptionsClassification interface for type OnYourDataVectorSearchAccessTokenAuthenticationOptions.

func (OnYourDataVectorSearchAccessTokenAuthenticationOptions) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type OnYourDataVectorSearchAccessTokenAuthenticationOptions.

func (*OnYourDataVectorSearchAccessTokenAuthenticationOptions) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataVectorSearchAccessTokenAuthenticationOptions.

type OnYourDataVectorSearchAuthenticationOptions

type OnYourDataVectorSearchAuthenticationOptions struct {
	// REQUIRED; The type of authentication to use.
	Type *OnYourDataVectorSearchAuthenticationType
}

OnYourDataVectorSearchAuthenticationOptions - The authentication options for Azure OpenAI On Your Data vector search.

func (*OnYourDataVectorSearchAuthenticationOptions) GetOnYourDataVectorSearchAuthenticationOptions

func (o *OnYourDataVectorSearchAuthenticationOptions) GetOnYourDataVectorSearchAuthenticationOptions() *OnYourDataVectorSearchAuthenticationOptions

GetOnYourDataVectorSearchAuthenticationOptions implements the OnYourDataVectorSearchAuthenticationOptionsClassification interface for type OnYourDataVectorSearchAuthenticationOptions.

func (OnYourDataVectorSearchAuthenticationOptions) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type OnYourDataVectorSearchAuthenticationOptions.

func (*OnYourDataVectorSearchAuthenticationOptions) UnmarshalJSON

func (o *OnYourDataVectorSearchAuthenticationOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataVectorSearchAuthenticationOptions.

type OnYourDataVectorSearchAuthenticationOptionsClassification

type OnYourDataVectorSearchAuthenticationOptionsClassification interface {
	// GetOnYourDataVectorSearchAuthenticationOptions returns the OnYourDataVectorSearchAuthenticationOptions content of the underlying type.
	GetOnYourDataVectorSearchAuthenticationOptions() *OnYourDataVectorSearchAuthenticationOptions
}

OnYourDataVectorSearchAuthenticationOptionsClassification provides polymorphic access to related types. Call the interface's GetOnYourDataVectorSearchAuthenticationOptions() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *OnYourDataVectorSearchAPIKeyAuthenticationOptions, *OnYourDataVectorSearchAccessTokenAuthenticationOptions, *OnYourDataVectorSearchAuthenticationOptions

type OnYourDataVectorSearchAuthenticationType

type OnYourDataVectorSearchAuthenticationType string

OnYourDataVectorSearchAuthenticationType - The authentication types supported with Azure OpenAI On Your Data vector search.

const (
	// OnYourDataVectorSearchAuthenticationTypeAPIKey - Authentication via API key.
	OnYourDataVectorSearchAuthenticationTypeAPIKey OnYourDataVectorSearchAuthenticationType = "api_key"
	// OnYourDataVectorSearchAuthenticationTypeAccessToken - Authentication via access token.
	OnYourDataVectorSearchAuthenticationTypeAccessToken OnYourDataVectorSearchAuthenticationType = "access_token"
)

func PossibleOnYourDataVectorSearchAuthenticationTypeValues

func PossibleOnYourDataVectorSearchAuthenticationTypeValues() []OnYourDataVectorSearchAuthenticationType

PossibleOnYourDataVectorSearchAuthenticationTypeValues returns the possible values for the OnYourDataVectorSearchAuthenticationType const type.

type OnYourDataVectorizationSource

type OnYourDataVectorizationSource struct {
	// REQUIRED; The type of vectorization source to use.
	Type *OnYourDataVectorizationSourceType
}

OnYourDataVectorizationSource - An abstract representation of a vectorization source for Azure OpenAI On Your Data with vector search.

func (*OnYourDataVectorizationSource) GetOnYourDataVectorizationSource

func (o *OnYourDataVectorizationSource) GetOnYourDataVectorizationSource() *OnYourDataVectorizationSource

GetOnYourDataVectorizationSource implements the OnYourDataVectorizationSourceClassification interface for type OnYourDataVectorizationSource.

func (OnYourDataVectorizationSource) MarshalJSON

func (o OnYourDataVectorizationSource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OnYourDataVectorizationSource.

func (*OnYourDataVectorizationSource) UnmarshalJSON

func (o *OnYourDataVectorizationSource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OnYourDataVectorizationSource.

type OnYourDataVectorizationSourceClassification

type OnYourDataVectorizationSourceClassification interface {
	// GetOnYourDataVectorizationSource returns the OnYourDataVectorizationSource content of the underlying type.
	GetOnYourDataVectorizationSource() *OnYourDataVectorizationSource
}

OnYourDataVectorizationSourceClassification provides polymorphic access to related types. Call the interface's GetOnYourDataVectorizationSource() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *OnYourDataDeploymentNameVectorizationSource, *OnYourDataEndpointVectorizationSource, *OnYourDataIntegratedVectorizationSource, - *OnYourDataModelIDVectorizationSource, *OnYourDataVectorizationSource

type OnYourDataVectorizationSourceType

type OnYourDataVectorizationSourceType string

OnYourDataVectorizationSourceType - Represents the available sources Azure OpenAI On Your Data can use to configure vectorization of data for use with vector search.

const (
	// OnYourDataVectorizationSourceTypeDeploymentName - Represents an Ada model deployment name to use. This model deployment
	// must be in the same Azure OpenAI resource, but
	// On Your Data will use this model deployment via an internal call rather than a public one, which enables vector
	// search even in private networks.
	OnYourDataVectorizationSourceTypeDeploymentName OnYourDataVectorizationSourceType = "deployment_name"
	// OnYourDataVectorizationSourceTypeEndpoint - Represents vectorization performed by public service calls to an Azure OpenAI
	// embedding model.
	OnYourDataVectorizationSourceTypeEndpoint OnYourDataVectorizationSourceType = "endpoint"
	// OnYourDataVectorizationSourceTypeIntegrated - Represents the integrated vectorizer defined within the search resource.
	OnYourDataVectorizationSourceTypeIntegrated OnYourDataVectorizationSourceType = "integrated"
	// OnYourDataVectorizationSourceTypeModelID - Represents a specific embedding model ID as defined in the search service.
	// Currently only supported by Elasticsearch®.
	OnYourDataVectorizationSourceTypeModelID OnYourDataVectorizationSourceType = "model_id"
)

func PossibleOnYourDataVectorizationSourceTypeValues

func PossibleOnYourDataVectorizationSourceTypeValues() []OnYourDataVectorizationSourceType

PossibleOnYourDataVectorizationSourceTypeValues returns the possible values for the OnYourDataVectorizationSourceType const type.

type PineconeChatExtensionConfiguration

type PineconeChatExtensionConfiguration struct {
	// REQUIRED; The parameters to use when configuring Azure OpenAI chat extensions.
	Parameters *PineconeChatExtensionParameters

	// REQUIRED; The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. Azure
	// chat extensions are only compatible with Azure OpenAI.
	Type *AzureChatExtensionType
}

PineconeChatExtensionConfiguration - A specific representation of configurable options for Pinecone when using it as an Azure OpenAI chat extension.

func (*PineconeChatExtensionConfiguration) GetAzureChatExtensionConfiguration

func (p *PineconeChatExtensionConfiguration) GetAzureChatExtensionConfiguration() *AzureChatExtensionConfiguration

GetAzureChatExtensionConfiguration implements the AzureChatExtensionConfigurationClassification interface for type PineconeChatExtensionConfiguration.

func (PineconeChatExtensionConfiguration) MarshalJSON

func (p PineconeChatExtensionConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PineconeChatExtensionConfiguration.

func (*PineconeChatExtensionConfiguration) UnmarshalJSON

func (p *PineconeChatExtensionConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PineconeChatExtensionConfiguration.

type PineconeChatExtensionParameters

type PineconeChatExtensionParameters struct {
	// REQUIRED; The embedding dependency for vector search.
	EmbeddingDependency OnYourDataVectorizationSourceClassification

	// REQUIRED; The environment name of Pinecone.
	Environment *string

	// REQUIRED; Customized field mapping behavior to use when interacting with the search index.
	FieldsMapping *PineconeFieldMappingOptions

	// REQUIRED; The name of the Pinecone database index.
	IndexName *string

	// If specified as true, the system will allow partial search results to be used and the request fails if all the queries
	// fail. If not specified, or specified as false, the request will fail if any
	// search query fails.
	AllowPartialResult *bool

	// The authentication method to use when accessing the defined data source. Each data source type supports a specific set
	// of available authentication methods; please see the documentation of the data
	// source for supported mechanisms. If not otherwise provided, On Your Data will attempt to use System Managed Identity (default
	// credential) authentication.
	Authentication OnYourDataAuthenticationOptionsClassification

	// Whether queries should be restricted to use of indexed data.
	InScope *bool

	// The included properties of the output context. If not specified, the default value is citations and intent.
	IncludeContexts []OnYourDataContextProperty

	// The max number of rewritten queries should be send to search provider for one user message. If not specified, the system
	// will decide the number of queries to send.
	MaxSearchQueries *int32

	// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but
	// lower recall of the answer.
	Strictness *int32

	// The configured top number of documents to feature for the configured query.
	TopNDocuments *int32
}

PineconeChatExtensionParameters - Parameters for configuring Azure OpenAI Pinecone chat extensions. The supported authentication type is APIKey.

func (PineconeChatExtensionParameters) MarshalJSON

func (p PineconeChatExtensionParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PineconeChatExtensionParameters.

func (*PineconeChatExtensionParameters) UnmarshalJSON

func (p *PineconeChatExtensionParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PineconeChatExtensionParameters.

type PineconeFieldMappingOptions

type PineconeFieldMappingOptions struct {
	// REQUIRED; The names of index fields that should be treated as content.
	ContentFields []string

	// The separator pattern that content fields should use.
	ContentFieldsSeparator *string

	// The name of the index field to use as a filepath.
	FilepathField *string

	// The name of the index field to use as a title.
	TitleField *string

	// The name of the index field to use as a URL.
	URLField *string
}

PineconeFieldMappingOptions - Optional settings to control how fields are processed when using a configured Pinecone resource.

func (PineconeFieldMappingOptions) MarshalJSON

func (p PineconeFieldMappingOptions) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PineconeFieldMappingOptions.

func (*PineconeFieldMappingOptions) UnmarshalJSON

func (p *PineconeFieldMappingOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PineconeFieldMappingOptions.

Jump to

Keyboard shortcuts

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