Skip to content

Commit

Permalink
Touchups for pr tool calling
Browse files Browse the repository at this point in the history
* branch naming convention
* hallucination minimization
  • Loading branch information
michaeljguarino committed Dec 4, 2024
1 parent d05fc9f commit af09403
Show file tree
Hide file tree
Showing 21 changed files with 349 additions and 53 deletions.
25 changes: 25 additions & 0 deletions assets/src/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,15 @@ export type AnthropicSettings = {
__typename?: 'AnthropicSettings';
/** the anthropic model version to use */
model?: Maybe<Scalars['String']['output']>;
/** the model to use for tool calls, which are less frequent and require more complex reasoning */
toolModel?: Maybe<Scalars['String']['output']>;
};

export type AnthropicSettingsAttributes = {
accessToken?: InputMaybe<Scalars['String']['input']>;
model?: InputMaybe<Scalars['String']['input']>;
/** the model to use for tool calls, which are less frequent and require more complex reasoning */
toolModel?: InputMaybe<Scalars['String']['input']>;
};

/** a representation of a kubernetes api deprecation */
Expand Down Expand Up @@ -635,6 +639,8 @@ export type AzureOpenaiAttributes = {
endpoint: Scalars['String']['input'];
/** the exact model you wish to use */
model?: InputMaybe<Scalars['String']['input']>;
/** the model to use for tool calls, which are less frequent and require more complex reasoning */
toolModel?: InputMaybe<Scalars['String']['input']>;
};

/** Settings for configuring against Azure OpenAI */
Expand All @@ -644,6 +650,9 @@ export type AzureOpenaiSettings = {
apiVersion?: Maybe<Scalars['String']['output']>;
/** the endpoint of your azure openai version, should look like: https://{endpoint}/openai/deployments/{deployment-id} */
endpoint: Scalars['String']['output'];
model?: Maybe<Scalars['String']['output']>;
/** the model to use for tool calls, which are less frequent and require more complex reasoning */
toolModel?: Maybe<Scalars['String']['output']>;
};

export type AzureSettingsAttributes = {
Expand Down Expand Up @@ -689,6 +698,8 @@ export type BedrockAiAttributes = {
modelId: Scalars['String']['input'];
/** aws secret access key to use, you can also use IRSA for self-hosted consoles */
secretAccessKey?: InputMaybe<Scalars['String']['input']>;
/** the model to use for tool calls, which are less frequent and require more complex reasoning */
toolModelId?: InputMaybe<Scalars['String']['input']>;
};

/** Settings for usage of AWS Bedrock for LLMs */
Expand All @@ -698,6 +709,8 @@ export type BedrockAiSettings = {
accessKeyId?: Maybe<Scalars['String']['output']>;
/** the bedrock model to use */
modelId: Scalars['String']['output'];
/** the model to use for tool calls, which are less frequent and require more complex reasoning */
toolModelId?: Maybe<Scalars['String']['output']>;
};

export type BindingAttributes = {
Expand Down Expand Up @@ -3879,13 +3892,17 @@ export type OllamaAttributes = {
/** An http authorization header to use on calls to the Ollama api */
authorization?: InputMaybe<Scalars['String']['input']>;
model: Scalars['String']['input'];
/** the model to use for tool calls, which are less frequent and require more complex reasoning */
toolModel?: InputMaybe<Scalars['String']['input']>;
url: Scalars['String']['input'];
};

/** Settings for a self-hosted ollama-based LLM deployment */
export type OllamaSettings = {
__typename?: 'OllamaSettings';
model: Scalars['String']['output'];
/** the model to use for tool calls, which are less frequent and require more complex reasoning */
toolModel?: Maybe<Scalars['String']['output']>;
/** the url your ollama deployment is hosted on */
url: Scalars['String']['output'];
};
Expand All @@ -3897,12 +3914,16 @@ export type OpenaiSettings = {
baseUrl?: Maybe<Scalars['String']['output']>;
/** the openai model version to use */
model?: Maybe<Scalars['String']['output']>;
/** the model to use for tool calls, which are less frequent and require more complex reasoning */
toolModel?: Maybe<Scalars['String']['output']>;
};

export type OpenaiSettingsAttributes = {
accessToken?: InputMaybe<Scalars['String']['input']>;
baseUrl?: InputMaybe<Scalars['String']['input']>;
model?: InputMaybe<Scalars['String']['input']>;
/** the model to use for tool calls, which are less frequent and require more complex reasoning */
toolModel?: InputMaybe<Scalars['String']['input']>;
};

export enum Operation {
Expand Down Expand Up @@ -9364,6 +9385,8 @@ export type VertexAiAttributes = {
project: Scalars['String']['input'];
/** optional service account json to auth to the GCP vertex apis */
serviceAccountJson?: InputMaybe<Scalars['String']['input']>;
/** the model to use for tool calls, which are less frequent and require more complex reasoning */
toolModel?: InputMaybe<Scalars['String']['input']>;
};

/** Settings for usage of GCP VertexAI for LLMs */
Expand All @@ -9375,6 +9398,8 @@ export type VertexAiSettings = {
model?: Maybe<Scalars['String']['output']>;
/** the gcp project id to use */
project: Scalars['String']['output'];
/** the model to use for tool calls, which are less frequent and require more complex reasoning */
toolModel?: Maybe<Scalars['String']['output']>;
};

export type VerticalPodAutoscaler = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ spec:
- key
type: object
x-kubernetes-map-type: atomic
toolModel:
description: Model to use for tool calling, which is less
frequent and often requires more advanced reasoning
type: string
required:
- tokenSecretRef
type: object
Expand Down Expand Up @@ -122,6 +126,10 @@ spec:
- key
type: object
x-kubernetes-map-type: atomic
toolModel:
description: Model to use for tool calling, which is less
frequent and often requires more advanced reasoning
type: string
required:
- endpoint
- tokenSecretRef
Expand Down Expand Up @@ -158,6 +166,10 @@ spec:
- key
type: object
x-kubernetes-map-type: atomic
toolModelId:
description: Model to use for tool calling, which is less
frequent and often requires more advanced reasoning
type: string
required:
- modelId
type: object
Expand Down Expand Up @@ -196,6 +208,10 @@ spec:
- key
type: object
x-kubernetes-map-type: atomic
toolModel:
description: Model to use for tool calling, which is less
frequent and often requires more advanced reasoning
type: string
url:
description: URL is the url this model is queryable on
type: string
Expand Down Expand Up @@ -236,6 +252,10 @@ spec:
- key
type: object
x-kubernetes-map-type: atomic
toolModel:
description: Model to use for tool calling, which is less
frequent and often requires more advanced reasoning
type: string
required:
- tokenSecretRef
type: object
Expand Down Expand Up @@ -288,6 +308,10 @@ spec:
- key
type: object
x-kubernetes-map-type: atomic
toolModel:
description: Model to use for tool calling, which is less
frequent and often requires more advanced reasoning
type: string
required:
- location
- project
Expand Down
29 changes: 27 additions & 2 deletions go/client/models_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions go/controller/api/v1alpha1/deploymentsettings_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ func (in *AISettings) Attributes(ctx context.Context, c client.Client, namespace
AccessToken: &token,
Model: in.OpenAI.Model,
BaseURL: in.OpenAI.BaseUrl,
ToolModel: in.OpenAI.ToolModel,
}
case console.AiProviderAnthropic:
if in.Anthropic == nil {
Expand All @@ -249,6 +250,7 @@ func (in *AISettings) Attributes(ctx context.Context, c client.Client, namespace
attr.Anthropic = &console.AnthropicSettingsAttributes{
AccessToken: lo.ToPtr(token),
Model: in.Anthropic.Model,
ToolModel: in.Anthropic.ToolModel,
}
case console.AiProviderAzure:
if in.Azure == nil {
Expand All @@ -264,6 +266,7 @@ func (in *AISettings) Attributes(ctx context.Context, c client.Client, namespace
Endpoint: in.Azure.Endpoint,
APIVersion: in.Azure.ApiVersion,
Model: in.Azure.Model,
ToolModel: in.Azure.ToolModel,
AccessToken: token,
}
case console.AiProviderVertex:
Expand Down Expand Up @@ -295,6 +298,7 @@ func (in *AISettings) Attributes(ctx context.Context, c client.Client, namespace

attr.Bedrock = &console.BedrockAiAttributes{
ModelID: in.Bedrock.ModelID,
ToolModelID: in.Bedrock.ToolModelId,
AccessKeyID: in.Bedrock.AccessKeyId,
SecretAccessKey: secret,
}
Expand All @@ -311,6 +315,7 @@ func (in *AISettings) Attributes(ctx context.Context, c client.Client, namespace
attr.Ollama = &console.OllamaAttributes{
URL: in.Ollama.URL,
Model: in.Ollama.Model,
ToolModel: in.Ollama.ToolModel,
Authorization: auth,
}
}
Expand All @@ -324,6 +329,11 @@ type AIProviderSettings struct {
// +kubebuilder:validation:Optional
Model *string `json:"model,omitempty"`

// Model to use for tool calling, which is less frequent and often requires more advanced reasoning
//
// +kubebuilder:validation:Optional
ToolModel *string `json:"toolModel,omitempty"`

// A custom base url to use, for reimplementations of the same API scheme (for instance Together.ai uses the OpenAI API spec)
//
// +kubebuilder:validation:Optional
Expand All @@ -348,6 +358,11 @@ type OllamaSettings struct {
// +kubebuilder:validation:Required
Model string `json:"model"`

// Model to use for tool calling, which is less frequent and often requires more advanced reasoning
//
// +kubebuilder:validation:Optional
ToolModel *string `json:"toolModel,omitempty"`

// TokenSecretRef is a reference to the local secret holding the contents of a HTTP Authorization header
// to send to your ollama api in case authorization is required (eg for an instance hosted on a public network)
//
Expand All @@ -371,6 +386,11 @@ type AzureOpenAISettings struct {
// +kubebuilder:validation:Optional
Model *string `json:"model,omitempty"`

// Model to use for tool calling, which is less frequent and often requires more advanced reasoning
//
// +kubebuilder:validation:Optional
ToolModel *string `json:"toolModel,omitempty"`

// TokenSecretRef is a reference to the local secret holding the token to access
// the configured AI provider.
//
Expand All @@ -384,6 +404,11 @@ type BedrockSettings struct {
// +kubebuilder:validation:Required
ModelID string `json:"modelId"`

// Model to use for tool calling, which is less frequent and often requires more advanced reasoning
//
// +kubebuilder:validation:Optional
ToolModelId *string `json:"toolModelId,omitempty"`

// An AWS Access Key ID to use, can also use IRSA to acquire credentials
//
// +kubebuilder:validation:Optional
Expand All @@ -401,6 +426,11 @@ type VertexSettings struct {
// +kubebuilder:validation:Optional
Model *string `json:"model,omitempty"`

// Model to use for tool calling, which is less frequent and often requires more advanced reasoning
//
// +kubebuilder:validation:Optional
ToolModel *string `json:"toolModel,omitempty"`

// The GCP project you'll be using
//
// +kubebuilder:validation:Required
Expand Down
Loading

0 comments on commit af09403

Please sign in to comment.