Skip to content

Commit

Permalink
move code gen to the cmd folder and add more context to generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
conneroisu committed Sep 6, 2024
1 parent 1277d0b commit 6f5fb00
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 46 deletions.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/rs/zerolog"
)

//go:generate go run ./scripts/models/main.go
//go:generate go run ./cmd/models/main.go

// Format is the format of a response.
// string
Expand Down
2 changes: 1 addition & 1 deletion scripts/models/go.mod → cmd/models/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/conneroisu/groq-go/scripts/models
module github.com/conneroisu/groq-go/cmd/models

go 1.23.0

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/models/models.go.txt → cmd/models/models.go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const (
TranscriptionTimestampGranularitySegment TranscriptionTimestampGranularity = "segment" // TranscriptionTimestampGranularitySegment is the segment timestamp granularity.

{{- range $model := .Models }}
// {{ $model.Name }} is an AI {{if isTextModel $model}}text{{else}}audio{{end}} model provided by {{$model.OwnedBy}}. It has {{$model.ContextWindow}} context window.
{{ $model.Name }} Model = "{{ $model.ID }}" {{- end }}
{{ $model.Name }} Model = "{{ $model.ID }}" // {{ $model.Name }} is an AI {{if isTextModel $model}}text{{else if isAudioModel $model}}audio{{else if isModerationModel $model}}moderation{{end}} model provided by {{$model.OwnedBy}}. It has {{$model.ContextWindow}} context window.
{{- end }}
)

var disabledModelsForEndpoints = map[Endpoint]map[Model]bool{
Expand Down
File renamed without changes.
71 changes: 29 additions & 42 deletions models.go

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

0 comments on commit 6f5fb00

Please sign in to comment.