Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(pre-commit): add yamlfmt #949

Merged
merged 1 commit into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ linters:

linters-settings:
stylecheck:
checks: [ "all" ]
checks: ["all"]
staticcheck:
checks: [ "all", "-SA1019" ]
checks: ["all", "-SA1019"]
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,16 @@ repos:
entry: bash -c 'make gen-component-doc'
language: system
files: ^pkg/component/.*\.(json|mdx)$
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.3
hooks:
- id: yamlfmt
args:
- --mapping
- "2"
- --sequence
- "4"
- --offset
- "2"
- --preserve-quotes
- --implicit_start
33 changes: 12 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,12 @@ require (
gorm.io/plugin/dbresolver v1.5.1
)

require (
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/oapi-codegen/runtime v1.1.1 // indirect
github.com/pinecone-io/go-pinecone v1.1.1
)

require (
github.com/machinebox/graphql v0.2.2
github.com/matryer/is v1.4.1 // indirect
)

require (
cloud.google.com/go v0.115.0 // indirect
cloud.google.com/go/auth v0.7.2 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.3 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
code.sajari.com/docconv v1.3.8
filippo.io/edwards25519 v1.1.0 // indirect
github.com/JalfResi/justext v0.0.0-20221106200834-be571e3e3052 // indirect
github.com/PaesslerAG/gval v1.0.0 // indirect
Expand All @@ -128,6 +118,8 @@ require (
github.com/antchfx/xmlquery v1.3.17 // indirect
github.com/antchfx/xpath v1.2.4 // indirect
github.com/apache/arrow/go/v15 v15.0.2 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/araddon/dateparse v0.0.0-20200409225146-d820a6159ab1 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go v1.55.1 // indirect
github.com/aws/aws-sdk-go-v2 v1.30.3 // indirect
Expand Down Expand Up @@ -209,7 +201,9 @@ require (
github.com/kr/text v0.2.0 // indirect
github.com/levigross/exp-html v0.0.0-20120902181939-8df60c69a8f5 // indirect
github.com/lib/pq v1.10.9
github.com/machinebox/graphql v0.2.2
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matryer/is v1.4.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
Expand All @@ -219,11 +213,13 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/montanaflynn/stats v0.7.1 // indirect
github.com/oapi-codegen/runtime v1.1.1 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/olekukonko/tablewriter v0.0.4 // indirect
github.com/otiai10/gosseract/v2 v2.4.1 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pierrec/lz4/v4 v4.1.18 // indirect
github.com/pinecone-io/go-pinecone v1.1.1
github.com/pkg/errors v0.9.1
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
Expand Down Expand Up @@ -265,24 +261,19 @@ require (
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/appengine v1.6.8 // indirect
modernc.org/mathutil v1.5.0 // indirect
)

require (
code.sajari.com/docconv v1.3.8
github.com/araddon/dateparse v0.0.0-20200409225146-d820a6159ab1 // indirect
go.opentelemetry.io/proto/otlp v1.1.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/crypto v0.31.0
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20240722135656-d784300faade // indirect
gopkg.in/yaml.v3 v3.0.1
gorm.io/driver/mysql v1.4.7 // indirect
modernc.org/mathutil v1.5.0 // indirect
)
2 changes: 1 addition & 1 deletion pkg/component/ai/anthropic/v0/config/definition.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
availableTasks:
- TASK_TEXT_GENERATION_CHAT
- TASK_TEXT_GENERATION_CHAT
custom: false
documentationUrl: https://www.instill.tech/docs/component/ai/anthropic
icon: assets/anthropic.svg
Expand Down
5 changes: 2 additions & 3 deletions pkg/component/ai/anthropic/v0/config/setup.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
additionalProperties: false
properties:
api-key:
description: Fill in your Anthropic API key. To find your keys, visit the Anthropic
console page.
description: Fill in your Anthropic API key. To find your keys, visit the Anthropic console page.
acceptFormats:
- string
- string
instillSecret: true
instillCredential: true
uiOrder: 0
Expand Down
100 changes: 46 additions & 54 deletions pkg/component/ai/anthropic/v0/config/tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $defs:
uiOrder: 0
format: string
required:
- url
- url
title: Image URL
description: The image URL.
uiOrder: 0
Expand All @@ -23,13 +23,13 @@ $defs:
type:
description: The type of the content part.
enum:
- text
- image_url
- text
- image_url
title: Type
uiOrder: 2
format: string
required:
- type
- type
format: object
format: array
chat-message:
Expand All @@ -45,8 +45,8 @@ $defs:
title: Role
format: string
required:
- role
- content
- role
- content
title: Chat Message
format: object
usage:
Expand All @@ -64,33 +64,28 @@ $defs:
title: Output Tokens
format: number
required:
- input-tokens
- output-tokens
- input-tokens
- output-tokens
title: Usage
format: object
TASK_TEXT_GENERATION_CHAT:
shortDescription: Provide text outputs in response to text inputs.
description: Anthropic's text generation models (often called generative pre-trained
transformers or large language models) have been trained to understand natural
language, code, and images. The models provide text outputs in response to their
inputs. The inputs to these models are also referred to as "prompts". Designing
a prompt is essentially how you “program” a large language model model, usually
by providing instructions or some examples of how to successfully complete a task.
description: Anthropic's text generation models (often called generative pre-trained transformers or large language models) have been trained to understand
natural language, code, and images. The models provide text outputs in response to their inputs. The inputs to these models are also referred to as
"prompts". Designing a prompt is essentially how you “program” a large language model model, usually by providing instructions or some examples of how
to successfully complete a task.
input:
description: Input.
uiOrder: 0
properties:
chat-history:
description: 'Incorporate external chat history, specifically previous messages
within the conversation. Please note that System Message will be ignored
and will not have any effect when this field is populated. Each message
should adhere to the format: : {"role": "The message role, i.e. ''system'',
''user'' or ''assistant''", "content": "message content"}.'
description: 'Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be
ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {"role": "The message role, i.e.
''system'', ''user'' or ''assistant''", "content": "message content"}.'
acceptFormats:
- object
shortDescription: 'Incorporate external chat history, specifically previous
messages within the conversation. (Note: Anthropic doesn''t support sending
images via image-url, use the ''prompt-images'' field instead)'
- object
shortDescription: 'Incorporate external chat history, specifically previous messages within the conversation. (Note: Anthropic doesn''t support
sending images via image-url, use the ''prompt-images'' field instead)'
uiOrder: 4
items:
$ref: '#/$defs/chat-message'
Expand All @@ -100,48 +95,47 @@ TASK_TEXT_GENERATION_CHAT:
default: 50
description: The maximum number of tokens for model to generate.
acceptFormats:
- integer
- integer
uiOrder: 6
title: Max New Tokens
format: integer
model-name:
enum:
- claude-3-5-sonnet-latest
- claude-3-5-sonnet-20241022
- claude-3-5-sonnet-20240620
- claude-3-opus-20240229
- claude-3-sonnet-20240229
- claude-3-haiku-20240307
example: claude-3-5-sonnet-latest
description: The Anthropic model to be used.
acceptFormats:
- string
uiOrder: 0
instillCredentialMap:
values:
- claude-3-5-sonnet-latest
- claude-3-5-sonnet-20241022
- claude-3-5-sonnet-20240620
- claude-3-opus-20240229
- claude-3-sonnet-20240229
- claude-3-haiku-20240307
example: claude-3-5-sonnet-latest
description: The Anthropic model to be used.
acceptFormats:
- string
uiOrder: 0
instillCredentialMap:
values:
- claude-3-5-sonnet-latest
- claude-3-5-sonnet-20241022
- claude-3-5-sonnet-20240620
- claude-3-opus-20240229
- claude-3-sonnet-20240229
- claude-3-haiku-20240307
targets:
- setup.api-key
- setup.api-key
title: Model Name
format: string
prompt:
description: The prompt text.
acceptFormats:
- string
- string
uiOrder: 2
title: Prompt
format: string
prompt-images:
description: 'The prompt images (Note: The prompt images will be injected
in the order they are provided to the ''prompt'' message. Anthropic doesn''t
description: 'The prompt images (Note: The prompt images will be injected in the order they are provided to the ''prompt'' message. Anthropic doesn''t
support sending images via image-url, use this field instead).'
acceptFormats:
- array
- array
uiOrder: 3
items:
format: string
Expand All @@ -150,19 +144,17 @@ TASK_TEXT_GENERATION_CHAT:
seed:
description: 'The seed (Note: Not supported by Anthropic Models).'
acceptFormats:
- integer
- integer
uiOrder: 4
title: Seed
format: integer
system-message:
default: You are a helpful assistant.
description: The system message helps set the behavior of the assistant. For
example, you can modify the personality of the assistant or provide specific
instructions about how it should behave throughout the conversation. By
default, the model’s behavior is set using a generic message as "You are
a helpful assistant.".
description: The system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide
specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is set using a generic message
as "You are a helpful assistant.".
acceptFormats:
- string
- string
shortDescription: The system message helps set the behavior of the assistant
uiOrder: 2
title: System Message
Expand All @@ -171,21 +163,21 @@ TASK_TEXT_GENERATION_CHAT:
default: 0.7
description: The temperature for sampling.
acceptFormats:
- number
- number
uiOrder: 5
title: Temperature
format: number
top-k:
default: 10
description: Top k for sampling.
acceptFormats:
- integer
- integer
uiOrder: 5
title: Top K
format: integer
required:
- prompt
- model-name
- prompt
- model-name
title: Input
format: object
output:
Expand All @@ -200,6 +192,6 @@ TASK_TEXT_GENERATION_CHAT:
usage:
$ref: '#/$defs/usage'
required:
- text
- text
title: Output
format: object
6 changes: 3 additions & 3 deletions pkg/component/ai/cohere/v0/config/definition.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
availableTasks:
- TASK_TEXT_GENERATION_CHAT
- TASK_TEXT_EMBEDDINGS
- TASK_TEXT_RERANKING
- TASK_TEXT_GENERATION_CHAT
- TASK_TEXT_EMBEDDINGS
- TASK_TEXT_RERANKING
documentationUrl: https://www.instill.tech/docs/component/ai/cohere
icon: assets/cohere.svg
id: cohere
Expand Down
5 changes: 2 additions & 3 deletions pkg/component/ai/cohere/v0/config/setup.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
additionalProperties: false
properties:
api-key:
description: Fill in your Cohere API key. To find your keys, visit the Cohere
dashboard page.
description: Fill in your Cohere API key. To find your keys, visit the Cohere dashboard page.
acceptFormats:
- string
- string
instillSecret: true
instillCredential: true
uiOrder: 0
Expand Down
Loading
Loading