From 2254e197cf209fd53cdc86bc8642404c9dad72bd Mon Sep 17 00:00:00 2001 From: Joel Bryan Juliano Date: Fri, 6 Sep 2024 07:16:51 +0200 Subject: [PATCH] updated gen code with dockerGPU and runMode setings --- gen/kdeps/Kdeps.pkl.go | 6 ++++- gen/kdeps/gpu/GPU.pkl.go | 37 +++++++++++++++++++++++++++++++ gen/kdeps/runmode/RunMode.pkl.go | 34 ++++++++++++++++++++++++++++ gen/llm/LLMSettings.pkl.go | 4 ++-- gen/llm/ResourceChat.pkl.go | 6 +++++ gen/llm/ResourceChatSchema.pkl.go | 6 +++++ 6 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 gen/kdeps/gpu/GPU.pkl.go create mode 100644 gen/kdeps/runmode/RunMode.pkl.go diff --git a/gen/kdeps/Kdeps.pkl.go b/gen/kdeps/Kdeps.pkl.go index 73d9274..838afcb 100644 --- a/gen/kdeps/Kdeps.pkl.go +++ b/gen/kdeps/Kdeps.pkl.go @@ -5,11 +5,15 @@ import ( "context" "github.com/apple/pkl-go/pkl" + "github.com/kdeps/schema/gen/kdeps/gpu" + "github.com/kdeps/schema/gen/kdeps/runmode" "github.com/kdeps/schema/gen/llm" ) type Kdeps struct { - DockerImage string `pkl:"dockerImage"` + RunMode runmode.RunMode `pkl:"runMode"` + + DockerGPU gpu.GPU `pkl:"dockerGPU"` LlmSettings *llm.LLMSettings `pkl:"llmSettings"` } diff --git a/gen/kdeps/gpu/GPU.pkl.go b/gen/kdeps/gpu/GPU.pkl.go new file mode 100644 index 0000000..825df02 --- /dev/null +++ b/gen/kdeps/gpu/GPU.pkl.go @@ -0,0 +1,37 @@ +// Code generated from Pkl module `org.kdeps.pkl.Kdeps`. DO NOT EDIT. +package gpu + +import ( + "encoding" + "fmt" +) + +type GPU string + +const ( + Nvidia GPU = "nvidia" + Amd GPU = "amd" + Cpu GPU = "cpu" +) + +// String returns the string representation of GPU +func (rcv GPU) String() string { + return string(rcv) +} + +var _ encoding.BinaryUnmarshaler = new(GPU) + +// UnmarshalBinary implements encoding.BinaryUnmarshaler for GPU. +func (rcv *GPU) UnmarshalBinary(data []byte) error { + switch str := string(data); str { + case "nvidia": + *rcv = Nvidia + case "amd": + *rcv = Amd + case "cpu": + *rcv = Cpu + default: + return fmt.Errorf(`illegal: "%s" is not a valid GPU`, str) + } + return nil +} diff --git a/gen/kdeps/runmode/RunMode.pkl.go b/gen/kdeps/runmode/RunMode.pkl.go new file mode 100644 index 0000000..a0d9e3b --- /dev/null +++ b/gen/kdeps/runmode/RunMode.pkl.go @@ -0,0 +1,34 @@ +// Code generated from Pkl module `org.kdeps.pkl.Kdeps`. DO NOT EDIT. +package runmode + +import ( + "encoding" + "fmt" +) + +type RunMode string + +const ( + Docker RunMode = "docker" + Local RunMode = "local" +) + +// String returns the string representation of RunMode +func (rcv RunMode) String() string { + return string(rcv) +} + +var _ encoding.BinaryUnmarshaler = new(RunMode) + +// UnmarshalBinary implements encoding.BinaryUnmarshaler for RunMode. +func (rcv *RunMode) UnmarshalBinary(data []byte) error { + switch str := string(data); str { + case "docker": + *rcv = Docker + case "local": + *rcv = Local + default: + return fmt.Errorf(`illegal: "%s" is not a valid RunMode`, str) + } + return nil +} diff --git a/gen/llm/LLMSettings.pkl.go b/gen/llm/LLMSettings.pkl.go index 413f38e..ebd8759 100644 --- a/gen/llm/LLMSettings.pkl.go +++ b/gen/llm/LLMSettings.pkl.go @@ -6,9 +6,9 @@ import "github.com/kdeps/schema/gen/llm/llmbackend" type LLMSettings struct { LlmAPIKeys *LLMAPIKeys `pkl:"llmAPIKeys"` - LlmBackend llmbackend.LLMBackend `pkl:"llmBackend"` + LlmFallbackBackend llmbackend.LLMBackend `pkl:"llmFallbackBackend"` - LlmModel string `pkl:"llmModel"` + LlmFallbackModel string `pkl:"llmFallbackModel"` ModelFile *ModelFile `pkl:"modelFile"` } diff --git a/gen/llm/ResourceChat.pkl.go b/gen/llm/ResourceChat.pkl.go index 05a1592..3fff6b6 100644 --- a/gen/llm/ResourceChat.pkl.go +++ b/gen/llm/ResourceChat.pkl.go @@ -1,7 +1,13 @@ // Code generated from Pkl module `org.kdeps.pkl.LLM`. DO NOT EDIT. package llm +import "github.com/kdeps/schema/gen/llm/llmbackend" + type ResourceChat struct { + Backend llmbackend.LLMBackend `pkl:"backend"` + + Model string `pkl:"model"` + Prompt string `pkl:"prompt"` Input *string `pkl:"input"` diff --git a/gen/llm/ResourceChatSchema.pkl.go b/gen/llm/ResourceChatSchema.pkl.go index 16bca82..89731e3 100644 --- a/gen/llm/ResourceChatSchema.pkl.go +++ b/gen/llm/ResourceChatSchema.pkl.go @@ -1,7 +1,13 @@ // Code generated from Pkl module `org.kdeps.pkl.LLM`. DO NOT EDIT. package llm +import "github.com/kdeps/schema/gen/llm/llmbackend" + type ResourceChatSchema struct { + Backend llmbackend.LLMBackend `pkl:"backend"` + + Model string `pkl:"model"` + Prompt string `pkl:"prompt"` Schema string `pkl:"schema"`