ai

package
v0.0.0-...-c119c96 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AzureAiStudioLink(tenantId string, subscriptionId string, resourceGroup string, workspaceName string) string

AzureAiStudioLink returns a link to the Azure AI Studio for the given tenant, subscription, resource group, and workspace

func ParseConfig

func ParseConfig[T comparable](config any) (*T, error)

ParseConfig parses a config from a generic interface.

Types

type ComponentConfig

type ComponentConfig struct {
	Name      osutil.ExpandableString            `yaml:"name,omitempty"`
	Path      string                             `yaml:"path,omitempty"`
	Overrides map[string]osutil.ExpandableString `yaml:"overrides,omitempty"`
}

ComponentConfig is a base configuration structure used by multiple AI components

type DeploymentConfig

type DeploymentConfig struct {
	ComponentConfig `yaml:",inline"`
	// A map of environment variables to set for the deployment
	Environment map[string]osutil.ExpandableString `yaml:"environment,omitempty"`
}

type EndpointDeploymentConfig

type EndpointDeploymentConfig struct {
	Workspace   osutil.ExpandableString `yaml:"workspace,omitempty"`
	Environment *ComponentConfig        `yaml:"environment,omitempty"`
	Model       *ComponentConfig        `yaml:"model,omitempty"`
	Flow        *ComponentConfig        `yaml:"flow,omitempty"`
	Deployment  *DeploymentConfig       `yaml:"deployment,omitempty"`
}

EndpointDeploymentConfig is a configuration structure for an ML online endpoint deployment

type Flow

type Flow struct {
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Type        string            `json:"type"`
	Path        string            `json:"path"`
	DisplayName string            `json:"display_name"`
	Tags        map[string]string `json:"tags"`
}

Flow is a configuration to defined a Prompt flow component

type PythonBridge

type PythonBridge interface {
	Initialize(ctx context.Context) error
	RequiredExternalTools(ctx context.Context) []tools.ExternalTool
	Run(ctx context.Context, scriptName ScriptPath, args ...string) (*exec.RunResult, error)
}

PythonBridge is an interface to execute python components from the embedded AI resources project

func NewPythonBridge

func NewPythonBridge(
	azdCtx *azdcontext.AzdContext,
	pythonCli *python.PythonCli,
) PythonBridge

NewPythonBridge creates a new PythonBridge instance

type Scope

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

Scope is a context based structure to define the Azure scope of a AI component

func NewScope

func NewScope(subscriptionId string, resourceGroup string, workspace string) *Scope

NewScope creates a new Scope instance

func (*Scope) ResourceGroup

func (s *Scope) ResourceGroup() string

ResourceGroup returns the resource group from the scope

func (*Scope) SubscriptionId

func (s *Scope) SubscriptionId() string

SubscriptionId returns the subscription ID from the scope

func (*Scope) Workspace

func (s *Scope) Workspace() string

Workspace returns the workspace from the scope

type ScriptPath

type ScriptPath string

ScriptPath is a type to represent the path of a Python script

const (
	// PromptFlowClient is the path to the PromptFlow Client Python script
	PromptFlowClient ScriptPath = "pf_client.py"
	// MLClient is the path to the ML Client Python script
	MLClient ScriptPath = "ml_client.py"
)

Jump to

Keyboard shortcuts

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