provider

package
v2.0.0-...-5a0ceae Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT, MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(version string) func() provider.Provider

func NewChatCompletionResource

func NewChatCompletionResource() resource.Resource

func NewCompletionResource

func NewCompletionResource() resource.Resource

func NewEmbeddingResource

func NewEmbeddingResource() resource.Resource

func NewImageResource

func NewImageResource() resource.Resource

Types

type ChatCompletionResource

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

ChatCompletionResource defines the resource implementation.

func (*ChatCompletionResource) Configure

func (*ChatCompletionResource) Create

func (*ChatCompletionResource) Delete

func (*ChatCompletionResource) ImportState

func (*ChatCompletionResource) Metadata

func (*ChatCompletionResource) Read

func (*ChatCompletionResource) Schema

func (*ChatCompletionResource) Update

type ChatCompletionResourceModel

type ChatCompletionResourceModel struct {
	Choices          []tfTypes.Choices                                `tfsdk:"choices"`
	Created          types.Int64                                      `tfsdk:"created"`
	FrequencyPenalty types.Number                                     `tfsdk:"frequency_penalty"`
	FunctionCall     *tfTypes.CreateChatCompletionRequestFunctionCall `tfsdk:"function_call"`
	Functions        []tfTypes.ChatCompletionFunctions                `tfsdk:"functions"`
	ID               types.String                                     `tfsdk:"id"`
	LogitBias        map[string]types.Int64                           `tfsdk:"logit_bias"`
	MaxTokens        types.Int64                                      `tfsdk:"max_tokens"`
	Messages         []tfTypes.ChatCompletionRequestMessage           `tfsdk:"messages"`
	Model            types.String                                     `tfsdk:"model"`
	N                types.Int64                                      `tfsdk:"n"`
	Object           types.String                                     `tfsdk:"object"`
	PresencePenalty  types.Number                                     `tfsdk:"presence_penalty"`
	Stop             *tfTypes.Stop                                    `tfsdk:"stop"`
	Stream           types.Bool                                       `tfsdk:"stream"`
	Temperature      types.Number                                     `tfsdk:"temperature"`
	TopP             types.Number                                     `tfsdk:"top_p"`
	Usage            *tfTypes.Usage                                   `tfsdk:"usage"`
	User             types.String                                     `tfsdk:"user"`
}

ChatCompletionResourceModel describes the resource data model.

func (*ChatCompletionResourceModel) RefreshFromSharedCreateChatCompletionResponse

func (r *ChatCompletionResourceModel) RefreshFromSharedCreateChatCompletionResponse(resp *shared.CreateChatCompletionResponse)

func (*ChatCompletionResourceModel) ToSharedCreateChatCompletionRequest

func (r *ChatCompletionResourceModel) ToSharedCreateChatCompletionRequest() *shared.CreateChatCompletionRequest

type CompletionResource

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

CompletionResource defines the resource implementation.

func (*CompletionResource) Configure

func (*CompletionResource) Create

func (*CompletionResource) Delete

func (*CompletionResource) ImportState

func (*CompletionResource) Metadata

func (*CompletionResource) Read

func (*CompletionResource) Schema

func (*CompletionResource) Update

type CompletionResourceModel

type CompletionResourceModel struct {
	BestOf           types.Int64                               `tfsdk:"best_of"`
	Choices          []tfTypes.CreateCompletionResponseChoices `tfsdk:"choices"`
	Created          types.Int64                               `tfsdk:"created"`
	Echo             types.Bool                                `tfsdk:"echo"`
	FrequencyPenalty types.Number                              `tfsdk:"frequency_penalty"`
	ID               types.String                              `tfsdk:"id"`
	LogitBias        map[string]types.Int64                    `tfsdk:"logit_bias"`
	Logprobs         types.Int64                               `tfsdk:"logprobs"`
	MaxTokens        types.Int64                               `tfsdk:"max_tokens"`
	Model            types.String                              `tfsdk:"model"`
	N                types.Int64                               `tfsdk:"n"`
	Object           types.String                              `tfsdk:"object"`
	PresencePenalty  types.Number                              `tfsdk:"presence_penalty"`
	Prompt           *tfTypes.Prompt                           `tfsdk:"prompt"`
	Stop             *tfTypes.Stop                             `tfsdk:"stop"`
	Stream           types.Bool                                `tfsdk:"stream"`
	Suffix           types.String                              `tfsdk:"suffix"`
	Temperature      types.Number                              `tfsdk:"temperature"`
	TopP             types.Number                              `tfsdk:"top_p"`
	Usage            *tfTypes.Usage                            `tfsdk:"usage"`
	User             types.String                              `tfsdk:"user"`
}

CompletionResourceModel describes the resource data model.

func (*CompletionResourceModel) RefreshFromSharedCreateCompletionResponse

func (r *CompletionResourceModel) RefreshFromSharedCreateCompletionResponse(resp *shared.CreateCompletionResponse)

func (*CompletionResourceModel) ToSharedCreateCompletionRequest

func (r *CompletionResourceModel) ToSharedCreateCompletionRequest() *shared.CreateCompletionRequest

type EmbeddingResource

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

EmbeddingResource defines the resource implementation.

func (*EmbeddingResource) Configure

func (*EmbeddingResource) Create

func (*EmbeddingResource) Delete

func (*EmbeddingResource) ImportState

func (*EmbeddingResource) Metadata

func (*EmbeddingResource) Read

func (*EmbeddingResource) Schema

func (*EmbeddingResource) Update

type EmbeddingResourceModel

type EmbeddingResourceModel struct {
	Data   []tfTypes.Data                       `tfsdk:"data"`
	Input  tfTypes.Prompt                       `tfsdk:"input"`
	Model  types.String                         `tfsdk:"model"`
	Object types.String                         `tfsdk:"object"`
	Usage  tfTypes.CreateEmbeddingResponseUsage `tfsdk:"usage"`
	User   types.String                         `tfsdk:"user"`
}

EmbeddingResourceModel describes the resource data model.

func (*EmbeddingResourceModel) RefreshFromSharedCreateEmbeddingResponse

func (r *EmbeddingResourceModel) RefreshFromSharedCreateEmbeddingResponse(resp *shared.CreateEmbeddingResponse)

func (*EmbeddingResourceModel) ToSharedCreateEmbeddingRequest

func (r *EmbeddingResourceModel) ToSharedCreateEmbeddingRequest() *shared.CreateEmbeddingRequest

type ImageResource

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

ImageResource defines the resource implementation.

func (*ImageResource) Configure

func (*ImageResource) Create

func (*ImageResource) Delete

func (*ImageResource) ImportState

func (*ImageResource) Metadata

func (*ImageResource) Read

func (*ImageResource) Schema

func (*ImageResource) Update

type ImageResourceModel

type ImageResourceModel struct {
	Created        types.Int64                  `tfsdk:"created"`
	Data           []tfTypes.ImagesResponseData `tfsdk:"data"`
	N              types.Int64                  `tfsdk:"n"`
	Prompt         types.String                 `tfsdk:"prompt"`
	ResponseFormat types.String                 `tfsdk:"response_format"`
	Size           types.String                 `tfsdk:"size"`
	User           types.String                 `tfsdk:"user"`
}

ImageResourceModel describes the resource data model.

func (*ImageResourceModel) RefreshFromSharedImagesResponse

func (r *ImageResourceModel) RefreshFromSharedImagesResponse(resp *shared.ImagesResponse)

func (*ImageResourceModel) ToSharedCreateImageRequest

func (r *ImageResourceModel) ToSharedCreateImageRequest() *shared.CreateImageRequest

type OpenaiProvider

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

func (*OpenaiProvider) Configure

func (*OpenaiProvider) DataSources

func (p *OpenaiProvider) DataSources(ctx context.Context) []func() datasource.DataSource

func (*OpenaiProvider) Metadata

func (*OpenaiProvider) Resources

func (p *OpenaiProvider) Resources(ctx context.Context) []func() resource.Resource

func (*OpenaiProvider) Schema

type OpenaiProviderModel

type OpenaiProviderModel struct {
	ServerURL types.String `tfsdk:"server_url"`
	APIKey    types.String `tfsdk:"api_key"`
}

OpenaiProviderModel describes the provider data model.

Directories

Path Synopsis
Package reflect is a forked version of https://github.com/hashicorp/terraform-plugin-framework/tree/main/internal/reflect that has been modified to support speakeasy's terraform generator.
Package reflect is a forked version of https://github.com/hashicorp/terraform-plugin-framework/tree/main/internal/reflect that has been modified to support speakeasy's terraform generator.

Jump to

Keyboard shortcuts

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