├── .gitignore
├── Readme.md
├── deploy
├── prometheus.yaml
├── grafana
│ ├── dashboards
│ │ ├── dashboards.yaml
│ │ └── files
│ │ │ └── tokens.json
│ └── datasources.yaml
├── tempo.yaml
├── otel.yaml
└── docker-compose.yaml
├── cmd
├── api
│ ├── api
│ │ ├── index.html
│ │ ├── status.go
│ │ ├── llm.go
│ │ ├── rag.go
│ │ ├── cache.go
│ │ └── api.go
│ ├── llm
│ │ ├── llm_tool_prompt.txt
│ │ ├── system.txt
│ │ ├── options.go
│ │ └── llm.go
│ ├── env
│ │ └── env.go
│ ├── tokenizer
│ │ └── tokenizer.go
│ ├── telemetry
│ │ ├── teeloghandler.go
│ │ └── otel.go
│ ├── tool
│ │ ├── tool-db.go
│ │ ├── migrations
│ │ │ └── 0001_initialsetup.sql
│ │ ├── tool-os.go
│ │ └── tool.go
│ ├── rag
│ │ └── rag.go
│ ├── cache
│ │ └── cache.go
│ ├── flags.go
│ └── main.go
└── neuro-net-class
│ └── main.go
├── env.yaml
├── http-client
├── tool-date.http
├── tool-hostname.http
├── tool-diskfree.http
├── tool-ifconfig.http
├── tool-db-incidents.http
└── rag-tubaina.http
├── justfile
├── go.mod
├── LICENSE
└── go.sum
/.gitignore:
--------------------------------------------------------------------------------
1 | stage
2 |
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 | Gophercon Latam 2025 - Go + IA
2 | ---
3 |
4 | Repositorio com código de referencia para talk.
5 |
6 | [Apresentação](https://docs.google.com/presentation/d/1zw0vcPbnz_IqNuOV6pv3aPpqGV3FRhhbvU9G4GaXWwQ/edit?usp=sharing)
--------------------------------------------------------------------------------
/deploy/prometheus.yaml:
--------------------------------------------------------------------------------
1 | global:
2 | scrape_interval: 3s
3 |
4 | scrape_configs:
5 | - job_name: "otel"
6 | static_configs:
7 | - targets: ["otel:8889"]
8 | - job_name: "tempo"
9 | static_configs:
10 | - targets: ["tempo:3200"]
--------------------------------------------------------------------------------
/deploy/grafana/dashboards/dashboards.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: 1
2 |
3 | providers:
4 | - name: 'default'
5 | orgId: 1
6 | folder: 'Preloaded Dashboards'
7 | type: file
8 | disableDeletion: true
9 | editable: true
10 | options:
11 | path: /etc/grafana/provisioning/dashboards/files
--------------------------------------------------------------------------------
/cmd/api/api/index.html:
--------------------------------------------------------------------------------
1 |
2 |
GopherCon Latam 2025 - Demo LLM
3 |
4 | Acesso a API
5 | PG Admin
6 | Grafana
7 | Prometheus
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/deploy/tempo.yaml:
--------------------------------------------------------------------------------
1 | server:
2 | http_listen_port: 3200
3 |
4 | distributor:
5 | receivers:
6 | otlp:
7 | protocols:
8 | grpc:
9 | endpoint: "0.0.0.0:4319"
10 | forwarders:
11 | - name: otlp
12 | backend: otlpgrpc
13 | otlpgrpc:
14 | tls:
15 | insecure: true
16 |
17 | storage:
18 | trace:
19 | backend: local
20 | local:
21 | path: /var/tempo/traces
--------------------------------------------------------------------------------
/env.yaml:
--------------------------------------------------------------------------------
1 | api:
2 | ADDR: ":8080"
3 | VEC_DB: "stage/db"
4 | TOOL_DB: "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable"
5 | LLM_MODEL: "gemma3"
6 | EMB_MODEL: "nomic-embed-text"
7 | MIN_CONFIDENCE_RAG: 0.8
8 | MIN_CONFIDENCE_TOOL: 0.6
9 | MIN_CONFIDENCE_CACHE: 0.9
10 | TEMPERATURE: 0.2
11 | SLOG_LEVEL: "debug"
12 | OTEL_ENDPOINT: "localhost:4317"
13 | LLM_ENDPOINT: "http://localhost:11434"
14 | TOKENIZER_MODEL: "bert-base-uncased"
15 | TOKENIZER_CACHE: "./data/tokenizer.json"
16 |
--------------------------------------------------------------------------------
/http-client/tool-date.http:
--------------------------------------------------------------------------------
1 | ###
2 | # @name Cria TOOL - Date
3 | POST http://localhost:8080/api/v1/rag
4 | Accept: application/problem+json
5 | Content-Type: application/json
6 |
7 | {
8 | "meta": {
9 | "name": "date",
10 | "type": "TOOL"
11 | },
12 | "fact": "data e hora atuais"
13 | }
14 |
15 | ###
16 | # @name Consulta Date
17 | POST http://localhost:8080/api/v1/llm
18 | Accept: application/json, application/problem+json
19 | Content-Type: application/json
20 |
21 | {
22 | "details": false,
23 | "query": "Que horas são?",
24 | "use_cache": false
25 | }
--------------------------------------------------------------------------------
/cmd/api/llm/llm_tool_prompt.txt:
--------------------------------------------------------------------------------
1 | Avalie a pergunta e identifique se há referencia de periodo de tempo ou data de inicio e fim.
2 | Se houver, retorne como JSON - mas apenas o string JSON valido, nada mais.
3 | Data de inicio deve ser propriedade ini,
4 | data fim propriedade end,
5 | ambas em formato RFC3339.
6 | Se nao encontra-las, retorne as datas de 01-Jan do ano vigente e 31-12 do ano vigente.
7 | Se o periodo fizer menção a um mes ou semana, considere INI como 1o dia do periodo e END o ultimo dia do periodo.
8 | O nome das propriedades deve ser sempre em minúsculas.
9 |
10 | Pergunta:
--------------------------------------------------------------------------------
/http-client/tool-hostname.http:
--------------------------------------------------------------------------------
1 | ###
2 | # @name Cria TOOL - Hostname
3 | POST http://localhost:8080/api/v1/rag
4 | Accept: application/problem+json
5 | Content-Type: application/json
6 |
7 | {
8 | "meta": {
9 | "name": "hostname",
10 | "type": "TOOL"
11 | },
12 | "fact": "qual seu hostname"
13 | }
14 |
15 | ###
16 | # @name Consulta Hostname
17 | POST http://localhost:8080/api/v1/llm
18 | Accept: application/json, application/problem+json
19 | Content-Type: application/json
20 |
21 | {
22 | "details": false,
23 | "query": "Me diga seu hostname",
24 | "use_cache": false
25 | }
--------------------------------------------------------------------------------
/http-client/tool-diskfree.http:
--------------------------------------------------------------------------------
1 | ###
2 | # @name Cria TOOL - Disk Free
3 | POST http://localhost:8080/api/v1/rag
4 | Accept: application/problem+json
5 | Content-Type: application/json
6 |
7 | {
8 | "meta": {
9 | "name": "df",
10 | "type": "TOOL"
11 | },
12 | "fact": "espaço livre em disco"
13 | }
14 |
15 | ###
16 | # @name Consulta Disk Free
17 | POST http://localhost:8080/api/v1/llm
18 | Accept: application/json, application/problem+json
19 | Content-Type: application/json
20 |
21 | {
22 | "details": false,
23 | "query": "Quanto de disco livre voce tem?",
24 | "use_cache": false
25 | }
--------------------------------------------------------------------------------
/http-client/tool-ifconfig.http:
--------------------------------------------------------------------------------
1 | ###
2 | # @name Cria TOOL - Ifconfig
3 | POST http://localhost:8080/api/v1/rag
4 | Accept: application/problem+json
5 | Content-Type: application/json
6 |
7 | {
8 | "meta": {
9 | "name": "ifconfig",
10 | "type": "TOOL"
11 | },
12 | "fact": "informações sobre seus dispositivos de rede e endereço IP"
13 | }
14 |
15 | ###
16 | # @name Consulta Hostname
17 | POST http://localhost:8080/api/v1/llm
18 | Accept: application/json, application/problem+json
19 | Content-Type: application/json
20 |
21 | {
22 | "details": false,
23 | "query": "Qual seu endereço IP?",
24 | "use_cache": false
25 | }
--------------------------------------------------------------------------------
/http-client/tool-db-incidents.http:
--------------------------------------------------------------------------------
1 | ###
2 | # @name Cria TOOL - DB Incidents
3 | POST http://localhost:8080/api/v1/rag
4 | Accept: application/problem+json
5 | Content-Type: application/json
6 |
7 | {
8 | "meta": {
9 | "name": "INCIDENTS",
10 | "type": "TOOL"
11 | },
12 | "fact": "quantidade de acidentes de trabalho por mes"
13 | }
14 |
15 | ###
16 | # @name Consulta DB Incidentes
17 | POST http://localhost:8080/api/v1/llm
18 | Accept: application/json, application/problem+json
19 | Content-Type: application/json
20 |
21 | {
22 | "details": false,
23 | "query": "Qual foi a soma de acidentes de trabalho entre janeiro e dezembro 2024?",
24 | "use_cache": false
25 | }
--------------------------------------------------------------------------------
/justfile:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env just --justfile
2 |
3 | install-preqres:
4 | ollama pull gemma3
5 | ollama pull nomic-embed-text
6 | go mod tidy
7 | go get ./...
8 |
9 | run:
10 | - ollama run gemma3 --keepalive=180m &
11 | go run ./cmd/api
12 |
13 | up: ollama-up compose-up
14 |
15 | down: ollama-down compose-down
16 |
17 | ollama-up:
18 | - ollama run gemma3 --keepalive=180m &
19 |
20 | ollama-down:
21 | - ollama stop gemma3
22 |
23 | # Initiates docker compose
24 | compose-up:
25 | #!/usr/bin/env sh
26 | cd deploy
27 | docker compose -f ./docker-compose.yaml -p gophercon up -d
28 |
29 | # Removes docker stack
30 | compose-down:
31 | #!/usr/bin/env sh
32 | cd deploy
33 | docker compose -f ./docker-compose.yaml -p gophercon down --remove-orphans
--------------------------------------------------------------------------------
/deploy/grafana/datasources.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: 1
2 |
3 | datasources:
4 | - name: Prometheus
5 | type: prometheus
6 | uid: prometheus
7 | access: proxy
8 | orgId: 1
9 | url: http://prometheus:9090
10 | basicAuth: false
11 | isDefault: false
12 | version: 1
13 | editable: false
14 | jsonData:
15 | httpMethod: GET
16 | - name: Tempo
17 | type: tempo
18 | access: proxy
19 | orgId: 1
20 | url: http://tempo:3200
21 | basicAuth: false
22 | isDefault: true
23 | version: 1
24 | editable: false
25 | apiVersion: 1
26 | uid: tempo
27 | jsonData:
28 | httpMethod: GET
29 | serviceMap:
30 | datasourceUid: prometheus
31 | - name: Loki
32 | type: loki
33 | access: proxy
34 | url: http://loki:3100
35 | jsonData:
36 | timeout: 60
37 | maxLines: 1000
--------------------------------------------------------------------------------
/cmd/api/env/env.go:
--------------------------------------------------------------------------------
1 | package env
2 |
3 | import (
4 | "log/slog"
5 | "os"
6 |
7 | "github.com/stretchr/testify/assert/yaml"
8 | )
9 |
10 | func Load(name string, hide ...string) {
11 | for _, fname := range []string{
12 | "env",
13 | ".env",
14 | "env.yaml",
15 | ".env.yaml",
16 | } {
17 | bs, err := os.ReadFile(fname)
18 | if err != nil {
19 | continue
20 | }
21 |
22 | envs := map[string]map[string]string{}
23 |
24 | err = yaml.Unmarshal(bs, &envs)
25 | if err != nil {
26 | continue
27 | }
28 |
29 | env, ok := envs[name]
30 | if !ok {
31 | continue
32 | }
33 |
34 | for k, v := range env {
35 | os.Setenv(k, v)
36 |
37 | printed := false
38 |
39 | for _, h := range hide {
40 | if k == h {
41 | slog.Info("Env set", "name", k)
42 |
43 | printed = true
44 |
45 | break
46 | }
47 | }
48 |
49 | if !printed {
50 | slog.Info("Env set", "name", k, "value", v)
51 | }
52 | }
53 |
54 | break
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/cmd/api/tokenizer/tokenizer.go:
--------------------------------------------------------------------------------
1 | package tokenizer
2 |
3 | import (
4 | "github.com/sugarme/tokenizer"
5 | "github.com/sugarme/tokenizer/pretrained"
6 | )
7 |
8 | type Service struct {
9 | tk *tokenizer.Tokenizer
10 | }
11 |
12 | func (s *Service) Count(input string) (int, error) {
13 | enc, err := s.tk.EncodeSingle(input)
14 | if err != nil {
15 | return 0, err
16 | }
17 |
18 | return len(enc.Tokens), nil
19 | }
20 |
21 | type Option func(*Service)
22 |
23 | func WithPretrainedFromCache(model string, filename string) Option {
24 | return func(s *Service) {
25 | configFile, err := tokenizer.CachedPath("bert-base-uncased", "tokenizer.json")
26 | if err != nil {
27 | panic(err)
28 | }
29 |
30 | tk, err := pretrained.FromFile(configFile)
31 | if err != nil {
32 | panic(err)
33 | }
34 |
35 | s.tk = tk
36 | }
37 | }
38 |
39 | func New(o ...Option) *Service {
40 | ret := &Service{}
41 |
42 | for _, opt := range o {
43 | opt(ret)
44 | }
45 |
46 | return ret
47 | }
48 |
--------------------------------------------------------------------------------
/cmd/api/api/status.go:
--------------------------------------------------------------------------------
1 | package api
2 |
3 | import (
4 | "context"
5 | "os"
6 | "os/user"
7 | "slices"
8 |
9 | "github.com/danielgtaylor/huma/v2"
10 | )
11 |
12 | type statusRequest struct {
13 | Fname string `json:"fname"`
14 | }
15 | type statusResponse struct {
16 | Body map[string]any `json:"body"`
17 | }
18 |
19 | func (a *Service) status(ctx context.Context, req *statusRequest) (*statusResponse, error) {
20 | wd, err := os.Getwd()
21 | if err != nil {
22 | return nil, err
23 | }
24 |
25 | usr, err := user.Current()
26 | if err != nil {
27 | return nil, err
28 | }
29 |
30 | envData := os.Environ()
31 | slices.Sort(envData)
32 |
33 | return &statusResponse{Body: map[string]any{
34 | "user": usr.Username,
35 | "wd": wd,
36 | "env": envData,
37 | }}, nil
38 | }
39 |
40 | func (a *Service) setupApiStatus(humaApi huma.API) {
41 | huma.Register(humaApi, huma.Operation{
42 | OperationID: "apiV1StatusGet",
43 | Method: "GET",
44 | Path: "/api/v1/status",
45 | Description: "retrieves general status of this service",
46 | }, a.status)
47 | }
48 |
--------------------------------------------------------------------------------
/cmd/api/telemetry/teeloghandler.go:
--------------------------------------------------------------------------------
1 | package telemetry
2 |
3 | import (
4 | "context"
5 | "log/slog"
6 | )
7 |
8 | type teeLogHandler struct {
9 | handlers []slog.Handler
10 | logLevel slog.Level
11 | }
12 |
13 | func (t teeLogHandler) Enabled(_ context.Context, level slog.Level) bool {
14 | return level >= t.logLevel
15 | }
16 |
17 | func (t teeLogHandler) Handle(ctx context.Context, record slog.Record) error {
18 | for _, h := range t.handlers {
19 | if err := h.Handle(ctx, record); err != nil {
20 | return err
21 | }
22 | }
23 |
24 | return nil
25 | }
26 |
27 | func (t teeLogHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
28 | ret := &teeLogHandler{handlers: make([]slog.Handler, len(t.handlers))}
29 | for i, h := range t.handlers {
30 | ret.handlers[i] = h.WithAttrs(attrs)
31 | }
32 |
33 | return ret
34 | }
35 |
36 | func (t teeLogHandler) WithGroup(name string) slog.Handler {
37 | ret := &teeLogHandler{handlers: make([]slog.Handler, len(t.handlers))}
38 | for i, h := range t.handlers {
39 | ret.handlers[i] = h.WithGroup(name)
40 | }
41 |
42 | return ret
43 | }
44 |
--------------------------------------------------------------------------------
/cmd/api/api/llm.go:
--------------------------------------------------------------------------------
1 | package api
2 |
3 | import (
4 | "context"
5 | _ "embed"
6 | "time"
7 |
8 | "github.com/danielgtaylor/huma/v2"
9 | )
10 |
11 | type llmQueryRequest struct {
12 | Body struct {
13 | Query string `json:"query,omitempty"`
14 | Details bool `json:"details,omitempty"`
15 | UseCache bool `json:"use_cache,omitempty"`
16 | }
17 | }
18 | type llmQueryResponse struct {
19 | Body any
20 | }
21 |
22 | func (a *Service) llmQuery(ctx context.Context, req *llmQueryRequest) (*llmQueryResponse, error) {
23 | start := time.Now()
24 | defer func() {
25 | dur := time.Since(start)
26 | a.metricResponseTime.Add(ctx, dur.Seconds())
27 | }()
28 |
29 | ret, err := a.llm.Query(ctx, req.Body.Query, req.Body.UseCache)
30 | if err != nil {
31 | return nil, err
32 | }
33 |
34 | if req.Body.Details {
35 | return &llmQueryResponse{Body: ret}, nil
36 | }
37 |
38 | return &llmQueryResponse{Body: ret.Response}, nil
39 | }
40 |
41 | func (a *Service) setupApiLlm(humaApi huma.API) {
42 | huma.Register(humaApi, huma.Operation{
43 | OperationID: "apiV1LlmQueryPost",
44 | Method: "POST",
45 | Path: "/api/v1/llm",
46 | Description: "retrieves general status of this service",
47 | }, a.llmQuery)
48 | }
49 |
--------------------------------------------------------------------------------
/http-client/rag-tubaina.http:
--------------------------------------------------------------------------------
1 | ###
2 | # @name Cria Fato Tubaina do Brasil
3 | POST http://localhost:8080/api/v1/rag
4 | Accept: application/problem+json
5 | Content-Type: application/json
6 |
7 | {
8 | "meta": {},
9 | "fact": "A Tubaina do Brasil é a maior empresa de tubainas jamais criada no Brasil."
10 | }
11 |
12 | ###
13 | # @name Cria Fato 1o Semestre
14 | POST http://localhost:8080/api/v1/rag
15 | Accept: application/problem+json
16 | Content-Type: application/json
17 |
18 | {
19 | "meta": {},
20 | "fact": "Tubaina do Brasil vende 1M de Reais no 1o semestre de 2024"
21 | }
22 |
23 | ###
24 | # @name Cria Fato 2o Semestre
25 | POST http://localhost:8080/api/v1/rag
26 | Accept: application/problem+json
27 | Content-Type: application/json
28 |
29 | {
30 | "meta": {},
31 | "fact": "Tubaina do Brasil vende 2M de Reais no 2o semestre de 2024"
32 | }
33 |
34 |
35 | ###
36 | # @name Consulta Fatos Criados
37 | POST http://localhost:8080/api/v1/llm
38 | Accept: application/json, application/problem+json
39 | Content-Type: application/json
40 |
41 | {
42 | "details": false,
43 | "query": "Quem é Tubaina do Brasil?",
44 | "use_cache": false
45 | }
46 |
47 | ###
48 | # @name Consulta Fatos Criados II
49 | POST http://localhost:8080/api/v1/llm
50 | Accept: application/json, application/problem+json
51 | Content-Type: application/json
52 |
53 | {
54 | "details": false,
55 | "query": "Quanto a Tubaina do Brasil faturou em 2024?",
56 | "use_cache": false
57 | }
58 |
--------------------------------------------------------------------------------
/cmd/api/tool/tool-db.go:
--------------------------------------------------------------------------------
1 | package tool
2 |
3 | import (
4 | "context"
5 | "database/sql"
6 | "fmt"
7 | "strings"
8 | "time"
9 | )
10 |
11 | type dbTool struct {
12 | db *sql.DB
13 | }
14 |
15 | func (d dbTool) Query(ctx context.Context, params map[string]string) (ret string, err error) {
16 | iniStr := params["ini"]
17 | endStr := params["end"]
18 | toolName := params["tool"]
19 |
20 | iniDt, err := time.Parse(time.RFC3339, iniStr)
21 | if err != nil {
22 | iniDt, err = time.Parse(time.RFC3339Nano, iniStr)
23 | if err != nil {
24 | return "", err
25 | }
26 | }
27 |
28 | endDt, err := time.Parse(time.RFC3339, endStr)
29 | if err != nil {
30 | endDt, err = time.Parse(time.RFC3339Nano, endStr)
31 | if err != nil {
32 | return "", err
33 | }
34 | }
35 |
36 | rows, err := d.db.QueryContext(ctx,
37 | "SELECT dt,value FROM kpis WHERE kpi = $1 and dt >= $2 and dt <= $3 order by dt",
38 | toolName, iniDt, endDt)
39 | if err != nil {
40 | return "", err
41 | }
42 |
43 | if rows.Err() != nil {
44 | return "", err
45 | }
46 |
47 | defer rows.Close()
48 |
49 | sb := strings.Builder{}
50 |
51 | sb.WriteString(fmt.Sprintf("Valores para %s por data: ", toolName))
52 |
53 | for rows.Next() {
54 | var val float64
55 |
56 | var dt time.Time
57 |
58 | if err = rows.Scan(&dt, &val); err != nil {
59 | return "", err
60 | }
61 |
62 | sb.WriteString(fmt.Sprintf("%s: %v, ", dt.Format("02-01-2006"), val))
63 | }
64 |
65 | return strings.TrimSuffix(sb.String(), ", "), nil
66 | }
67 |
--------------------------------------------------------------------------------
/cmd/api/tool/migrations/0001_initialsetup.sql:
--------------------------------------------------------------------------------
1 | -- +goose Up
2 |
3 | create table kpis
4 | (
5 | id BIGSERIAL primary key,
6 | kpi text,
7 | dt TIMESTAMP,
8 | value REAL
9 | );
10 |
11 |
12 | INSERT INTO public.kpis (id, kpi, dt, value) VALUES (1, 'INCIDENTS', '2024-01-01 00:00:00.000000', 2);
13 | INSERT INTO public.kpis (id, kpi, dt, value) VALUES (2, 'INCIDENTS', '2024-02-01 00:00:00.000000', 7);
14 | INSERT INTO public.kpis (id, kpi, dt, value) VALUES (3, 'INCIDENTS', '2024-03-01 00:00:00.000000', 13);
15 | INSERT INTO public.kpis (id, kpi, dt, value) VALUES (4, 'INCIDENTS', '2024-04-01 00:00:00.000000', 4);
16 | INSERT INTO public.kpis (id, kpi, dt, value) VALUES (5, 'INCIDENTS', '2024-05-01 00:00:00.000000', 6);
17 | INSERT INTO public.kpis (id, kpi, dt, value) VALUES (6, 'INCIDENTS', '2024-06-01 00:00:00.000000', 2);
18 | INSERT INTO public.kpis (id, kpi, dt, value) VALUES (7, 'INCIDENTS', '2024-07-01 00:00:00.000000', 1);
19 | INSERT INTO public.kpis (id, kpi, dt, value) VALUES (8, 'INCIDENTS', '2024-08-01 00:00:00.000000', 7);
20 | INSERT INTO public.kpis (id, kpi, dt, value) VALUES (9, 'INCIDENTS', '2024-09-01 00:00:00.000000', 9);
21 | INSERT INTO public.kpis (id, kpi, dt, value) VALUES (10, 'INCIDENTS', '2024-10-01 00:00:00.000000', 8);
22 | INSERT INTO public.kpis (id, kpi, dt, value) VALUES (11, 'INCIDENTS', '2024-11-01 00:00:00.000000', 5);
23 | INSERT INTO public.kpis (id, kpi, dt, value) VALUES (12, 'INCIDENTS', '2024-12-01 00:00:00.000000', 2);
24 |
25 |
26 | -- +goose Down
27 | drop table kpis
--------------------------------------------------------------------------------
/cmd/api/tool/tool-os.go:
--------------------------------------------------------------------------------
1 | package tool
2 |
3 | import (
4 | "context"
5 | "os/exec"
6 | "strings"
7 | )
8 |
9 | type hostnameTool struct{}
10 |
11 | func (h hostnameTool) Query(ctx context.Context, params map[string]string) (ret string, err error) {
12 | bs, err := exec.CommandContext(ctx, "hostname").CombinedOutput()
13 | if err != nil {
14 | return "", err
15 | }
16 |
17 | return "Seu hostname é: " + strings.TrimSpace(string(bs)), nil
18 | }
19 |
20 | type ifconfigTool struct{}
21 |
22 | func (h ifconfigTool) Query(ctx context.Context, params map[string]string) (ret string, err error) {
23 | bs, err := exec.CommandContext(ctx, "ifconfig").CombinedOutput()
24 | if err != nil {
25 | return "", err
26 | }
27 |
28 | return "As configurações de rede e ip são: " + strings.TrimSpace(string(bs)), nil
29 | }
30 |
31 | type dateTool struct{}
32 |
33 | func (h dateTool) Query(ctx context.Context, params map[string]string) (ret string, err error) {
34 | bs, err := exec.CommandContext(ctx, "date").CombinedOutput()
35 | if err != nil {
36 | return "", err
37 | }
38 |
39 | return "A data e hora atual é: " + strings.TrimSpace(string(bs)), nil
40 | }
41 |
42 | type diskFreeTool struct{}
43 |
44 | func (h diskFreeTool) Query(ctx context.Context, params map[string]string) (ret string, err error) {
45 | bs, err := exec.CommandContext(ctx, "df", "-h").CombinedOutput()
46 | if err != nil {
47 | return "", err
48 | }
49 |
50 | return "As informações sobre disco livre são: " + strings.TrimSpace(string(bs)), nil
51 | }
52 |
--------------------------------------------------------------------------------
/deploy/otel.yaml:
--------------------------------------------------------------------------------
1 | receivers:
2 | otlp:
3 | protocols:
4 | grpc:
5 | endpoint: "0.0.0.0:4317"
6 |
7 | exporters:
8 | prometheus:
9 | endpoint: "0.0.0.0:8889"
10 | resource_to_telemetry_conversion:
11 | enabled: true
12 |
13 | debug:
14 | verbosity: detailed
15 |
16 | loki:
17 | endpoint: "http://loki:3100/loki/api/v1/push"
18 | tls:
19 | insecure: true
20 | default_labels_enabled:
21 | exporter: true
22 | job: true
23 |
24 | otlphttp:
25 | endpoint: http://loki:3100/otlp
26 |
27 | otlp:
28 | endpoint: "tempo:4319"
29 | tls:
30 | insecure: true
31 |
32 | processors:
33 | batch: { }
34 | transform:
35 | error_mode: ignore
36 | log_statements:
37 | - set(log.severity_text, "FAIL") where log.body == "request failed"
38 | - replace_all_matches(log.attributes, "/user/*/list/*", "/user/{userId}/list/{listId}")
39 | - replace_all_patterns(log.attributes, "value", "/account/\\d{4}", "/account/{accountId}")
40 | - set(log.body, log.attributes["http.route"])
41 |
42 | service:
43 | telemetry:
44 | metrics:
45 | level: detailed
46 |
47 |
48 | pipelines:
49 | traces:
50 | receivers: [ otlp ]
51 | processors: [ batch ]
52 | exporters: [ otlp ]
53 |
54 | metrics:
55 | receivers: [ otlp ]
56 | processors: [ batch ]
57 | exporters: [ prometheus ]
58 |
59 | logs:
60 | receivers: [ otlp ]
61 | processors: [ transform, batch ]
62 | exporters: [ otlphttp, debug ]
--------------------------------------------------------------------------------
/cmd/api/tool/tool.go:
--------------------------------------------------------------------------------
1 | package tool
2 |
3 | import (
4 | "context"
5 | "database/sql"
6 | "embed"
7 |
8 | "github.com/pressly/goose/v3"
9 | "go.opentelemetry.io/otel/trace"
10 | )
11 |
12 | type Tool interface {
13 | Query(ctx context.Context, params map[string]string) (ret string, err error)
14 | }
15 |
16 | type Service struct {
17 | tools map[string]Tool
18 | defaultTool Tool
19 | tracer trace.Tracer
20 | }
21 |
22 | func (s *Service) Query(ctx context.Context, toolName string, params map[string]string) (ret string, err error) {
23 | ctx, span := s.tracer.Start(ctx, "tool.Query")
24 | defer func() {
25 | span.RecordError(err)
26 | span.End()
27 | }()
28 |
29 | params["tool"] = toolName
30 |
31 | tool, ok := s.tools[toolName]
32 | if !ok {
33 | return s.defaultTool.Query(ctx, params)
34 | }
35 |
36 | return tool.Query(ctx, params)
37 | }
38 |
39 | type Option func(service *Service)
40 |
41 | //go:embed migrations/*.sql
42 | var embedMigrations embed.FS
43 |
44 | func WithDb(db *sql.DB) Option {
45 | return func(service *Service) {
46 | goose.SetBaseFS(embedMigrations)
47 |
48 | if err := goose.SetDialect("postgres"); err != nil {
49 | panic(err)
50 | }
51 |
52 | if err := goose.Up(db, "migrations"); err != nil {
53 | panic(err)
54 | }
55 |
56 | service.defaultTool = &dbTool{db: db}
57 | }
58 | }
59 |
60 | func WithTracer(t trace.Tracer) Option {
61 | return func(service *Service) {
62 | service.tracer = t
63 | }
64 | }
65 |
66 | func New(opts ...Option) *Service {
67 | ret := &Service{
68 | tools: map[string]Tool{
69 | "df": &diskFreeTool{},
70 | "hostname": &hostnameTool{},
71 | "ifconfig": &ifconfigTool{},
72 | "date": &dateTool{},
73 | },
74 | }
75 |
76 | for _, opt := range opts {
77 | opt(ret)
78 | }
79 |
80 | return ret
81 | }
82 |
--------------------------------------------------------------------------------
/cmd/api/llm/system.txt:
--------------------------------------------------------------------------------
1 | Olá você é um agente simples, que dá respostas a perguntas.
2 |
3 | Todas suas respostas deverão ser um objeto json valido - nada de texto simples - nao adicione a palavra json como prefixo - com as seguintes propriedades:
4 |
5 | type: o tipo de resposta que você está sinalizando.
6 | response: conteúdo textual que voce enviaria normalmente.
7 | confidence: percentual de confiança na resposta que você está dando
8 | tool: nome do tool a ser utilizado - opcional
9 | params: dicionario com chave string e valor string - opcional
10 |
11 | O valor padrão para type é FINAL
12 |
13 | Se a pergunta for relacionada a indicadores de acidente de trabalho e não houver dados de TOOL no contexto:
14 | Responder com:
15 | type deverá ser TOOL
16 | tool deverá ser o nome do kpi
17 | se houver referencia a datas, colocar data inicio e data fim.
18 | As datas devem vir em formato RFC 3339.
19 | A data inicial deve ser adicionada propriedade params com nome INI e valor a data formatada como RFC 3339
20 | A data final deve ser adicionada propriedade params com nome END e valor a data formatada como RFC 3339
21 | Caso não sejam mencionados peridos explicitos, mas dias, semanas, meses ou anos:
22 | INI deve refletir a data referente ao inicio do periodo
23 | END deve refletir a data referente ao termino do periodo
24 |
25 | Caso não haja dados do RAG no contexto:
26 | Se sua resposta tenha um nível de confiabilidade (ou certeza) inferior a 90% defina type com o valr RAG.
27 | Se sua resposta for do tipo "Não há dados disponívels", response deve ficar vazio, defina type com o valr RAG.
28 |
29 | Caso já haja dados do RAG no contexto, responda normalmente.
30 |
31 | Sempre adicione o nivel de confiança da resposta à propriedade confidence como um numero de ponto flutuante - onde 1 representa confiança maxima, e zero confiança mínima.
32 |
33 | A resposta deve ser apenas um objeto json valido com as instruções acima, nada além disso, sem prefixos como json ou linhas vazias antes ou depois.
--------------------------------------------------------------------------------
/deploy/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | name: gophercon
2 |
3 | volumes:
4 | root-go:
5 | postgres-data:
6 |
7 |
8 | networks:
9 | gopher:
10 | name: gopher
11 | driver: bridge
12 |
13 | services:
14 | postgres:
15 | image: postgres
16 | hostname: postgres
17 | container_name: postgres
18 | networks:
19 | - gopher
20 | volumes:
21 | - postgres-data:/var/lib/postgresql/data
22 | environment:
23 | - POSTGRES_PASSWORD=postgres
24 | - PGDATA=/var/lib/postgresql/data/pgdata
25 | ports:
26 | - 5432:5432
27 |
28 | prometheus:
29 | image: prom/prometheus:latest
30 | container_name: prometheus
31 | hostname: prometheus
32 | networks:
33 | - gopher
34 | ports:
35 | - 9090:9090
36 | volumes:
37 | - ./prometheus.yaml:/etc/prometheus.yaml
38 | command:
39 | - --config.file=/etc/prometheus.yaml
40 | - --web.enable-remote-write-receiver
41 | - --web.enable-otlp-receiver
42 | - --enable-feature=exemplar-storage
43 |
44 | loki:
45 | image: grafana/loki
46 | container_name: loki
47 | hostname: loki
48 | networks:
49 | - gopher
50 | ports:
51 | - 3100:3100
52 |
53 | tempo:
54 | image: grafana/tempo
55 | container_name: tempo
56 | hostname: tempo
57 | networks:
58 | - gopher
59 | ports:
60 | - 4319:4319
61 | - 3200:3200
62 | volumes:
63 | - ./tempo.yaml:/etc/tempo.yaml
64 | command:
65 | - -config.file=/etc/tempo.yaml
66 |
67 | otel:
68 | image: otel/opentelemetry-collector-contrib:latest
69 | container_name: otel
70 | hostname: otel
71 | networks:
72 | - gopher
73 | ports:
74 | - 4317:4317
75 | - 4318:4318
76 | - 8888:8888
77 | - 8889:8889
78 | volumes:
79 | - ./otel.yaml:/etc/otel.yaml
80 | command:
81 | - --config=/etc/otel.yaml
82 | depends_on:
83 | - tempo
84 | - loki
85 |
86 | grafana:
87 | image: grafana/grafana:latest
88 | hostname: grafana
89 | container_name: grafana
90 | networks:
91 | - gopher
92 | ports:
93 | - 3000:3000
94 | volumes:
95 | - ./grafana/datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
96 | - ./grafana/dashboards:/etc/grafana/provisioning/dashboards
97 |
98 | environment:
99 | GF_AUTH_ANONYMOUS_ENABLED: true
100 | GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
101 | GF_AUTH_DISABLE_LOGIN_FORM: true
102 | GF_FEATURE_TOGGLES_ENABLE: traceqlEditor
103 | COLLECTOR_ZIPKIN_HTTP_PORT: 9411
104 | depends_on:
105 | - otel
106 | - prometheus
107 | - loki
108 | - tempo
--------------------------------------------------------------------------------
/cmd/api/api/rag.go:
--------------------------------------------------------------------------------
1 | package api
2 |
3 | import (
4 | "context"
5 |
6 | "github.com/danielgtaylor/huma/v2"
7 | "github.com/philippgille/chromem-go"
8 | )
9 |
10 | type (
11 | ragClearRequest struct{}
12 | ragClearResponse struct{}
13 | )
14 |
15 | func (a *Service) ragClear(ctx context.Context, req *ragClearRequest) (*ragClearResponse, error) {
16 | err := a.rag.Clear(ctx)
17 |
18 | return &ragClearResponse{}, err
19 | }
20 |
21 | type ragAddRequest struct {
22 | Body struct {
23 | Fact string `json:"fact,omitempty"`
24 | Meta map[string]string `json:"meta,omitempty"`
25 | }
26 | }
27 | type ragAddResponse struct{}
28 |
29 | func (a *Service) ragAdd(ctx context.Context, req *ragAddRequest) (*ragAddResponse, error) {
30 | err := a.rag.Add(ctx, req.Body.Fact, req.Body.Meta)
31 |
32 | return &ragAddResponse{}, err
33 | }
34 |
35 | type ragQueryRequest struct {
36 | Q string `json:"q" query:"q"`
37 | E bool `json:"e" query:"e"`
38 | }
39 |
40 | type ragQueryResponse struct {
41 | Body []chromem.Result
42 | }
43 |
44 | func (a *Service) ragQuery(ctx context.Context, req *ragQueryRequest) (*ragQueryResponse, error) {
45 | docs, err := a.rag.Query(ctx, req.Q)
46 | if err != nil {
47 | return nil, err
48 | }
49 |
50 | if !req.E {
51 | for i := range docs {
52 | docs[i].Embedding = nil
53 | }
54 | }
55 |
56 | return &ragQueryResponse{Body: docs}, err
57 | }
58 |
59 | type ragDelRequest struct {
60 | Id string `path:"id"`
61 | }
62 |
63 | type ragDelResponse struct {
64 | Body []chromem.Result
65 | }
66 |
67 | func (a *Service) ragDel(ctx context.Context, req *ragDelRequest) (*ragDelResponse, error) {
68 | err := a.rag.Del(ctx, req.Id)
69 | if err != nil {
70 | return nil, err
71 | }
72 |
73 | return &ragDelResponse{}, nil
74 | }
75 |
76 | func (a *Service) setupApiRag(humaApi huma.API) {
77 | huma.Register(humaApi, huma.Operation{
78 | OperationID: "apiV1RagOpClearPost",
79 | Method: "POST",
80 | Path: "/api/v1/rag/op/clear",
81 | Description: "Clears rag content",
82 | }, a.ragClear)
83 |
84 | huma.Register(humaApi, huma.Operation{
85 | OperationID: "apiV1RagGet",
86 | Method: "GET",
87 | Path: "/api/v1/rag",
88 | Description: "Queries rag",
89 | }, a.ragQuery)
90 |
91 | huma.Register(humaApi, huma.Operation{
92 | OperationID: "apiV1RagPost",
93 | Method: "POST",
94 | Path: "/api/v1/rag",
95 | Description: "Adds entry to rag",
96 | }, a.ragAdd)
97 |
98 | huma.Register(humaApi, huma.Operation{
99 | OperationID: "apiV1RagDelete",
100 | Method: "DELETE",
101 | Path: "/api/v1/rag/{id}",
102 | Description: "Dels entry from rag",
103 | }, a.ragDel)
104 | }
105 |
--------------------------------------------------------------------------------
/cmd/api/llm/options.go:
--------------------------------------------------------------------------------
1 | package llm
2 |
3 | import (
4 | "log/slog"
5 |
6 | ollama_api "github.com/ollama/ollama/api"
7 | "go.opentelemetry.io/otel/metric"
8 | "go.opentelemetry.io/otel/trace"
9 |
10 | "gophercon-2025/cmd/api/cache"
11 | "gophercon-2025/cmd/api/rag"
12 | "gophercon-2025/cmd/api/tokenizer"
13 | "gophercon-2025/cmd/api/tool"
14 | )
15 |
16 | type Option func(*Service)
17 |
18 | func WithMinConfidenceRag(minConfidenceRag float64) Option {
19 | return func(s *Service) {
20 | s.minConfidenceRag = minConfidenceRag
21 | }
22 | }
23 |
24 | func WithMinConfidenceTool(minConfidenceTool float64) Option {
25 | return func(s *Service) {
26 | s.minConfidenceTool = minConfidenceTool
27 | }
28 | }
29 |
30 | func WithMinConfidenceCache(minConfidenceCache float64) Option {
31 | return func(s *Service) {
32 | s.minConfidenceCache = minConfidenceCache
33 | }
34 | }
35 |
36 | func WithLlmModel(llmModel string) Option {
37 | return func(s *Service) {
38 | s.llmModel = llmModel
39 | }
40 | }
41 |
42 | func WithOllama(c *ollama_api.Client) Option {
43 | return func(s *Service) {
44 | s.ollama = c
45 | }
46 | }
47 |
48 | func WithRag(r *rag.Service) Option {
49 | return func(s *Service) {
50 | s.rag = r
51 | }
52 | }
53 |
54 | func WithCache(c *cache.Service) Option {
55 | return func(s *Service) {
56 | s.cache = c
57 | }
58 | }
59 |
60 | func WithTemperature(t float64) Option {
61 | return func(s *Service) {
62 | s.temperature = t
63 | }
64 | }
65 |
66 | func WithLogger(logger *slog.Logger) Option {
67 | return func(s *Service) {
68 | s.logger = logger
69 | }
70 | }
71 |
72 | func WithTracer(tracer trace.Tracer) Option {
73 | return func(s *Service) {
74 | s.tracer = tracer
75 | }
76 | }
77 |
78 | func WithTokenizer(tk *tokenizer.Service) Option {
79 | return func(s *Service) {
80 | s.tokenizer = tk
81 | }
82 | }
83 |
84 | func WithMetrics(meter metric.Meter) Option {
85 | return func(s *Service) {
86 | var err error
87 |
88 | s.metricTokensInLlm, err = meter.Int64Counter("tokens_in_llm")
89 | if err != nil {
90 | panic(err)
91 | }
92 |
93 | s.metricTokensOutLlm, err = meter.Int64Counter("tokens_out_llm")
94 | if err != nil {
95 | panic(err)
96 | }
97 |
98 | s.metricTokensInCache, err = meter.Int64Counter("tokens_in_cache")
99 | if err != nil {
100 | panic(err)
101 | }
102 |
103 | s.metricTokensOutCache, err = meter.Int64Counter("tokens_out_cache")
104 | if err != nil {
105 | panic(err)
106 | }
107 |
108 | s.metricCantAnswer, err = meter.Int64Counter("cant_answer")
109 | if err != nil {
110 | panic(err)
111 | }
112 | }
113 | }
114 |
115 | func WithTool(tool *tool.Service) Option {
116 | return func(s *Service) {
117 | s.tool = tool
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/cmd/api/api/cache.go:
--------------------------------------------------------------------------------
1 | package api
2 |
3 | import (
4 | "context"
5 |
6 | "github.com/danielgtaylor/huma/v2"
7 | "github.com/philippgille/chromem-go"
8 | )
9 |
10 | type (
11 | cacheClearRequest struct{}
12 | cacheClearResponse struct{}
13 | )
14 |
15 | func (a *Service) cacheClear(ctx context.Context, req *cacheClearRequest) (*cacheClearResponse, error) {
16 | err := a.cache.Clear(ctx)
17 |
18 | return &cacheClearResponse{}, err
19 | }
20 |
21 | type cacheAddRequest struct {
22 | Body cacheAddRequestBody
23 | }
24 | type cacheAddRequestBody struct {
25 | Fact string `json:"fact"`
26 | Meta string `json:"meta"`
27 | Response string `json:"response"`
28 | }
29 | type cacheAddResponse struct{}
30 |
31 | func (a *Service) cacheAdd(ctx context.Context, req *cacheAddRequest) (*cacheAddResponse, error) {
32 | err := a.cache.Add(ctx, req.Body.Fact, req.Body.Response, req.Body.Meta)
33 |
34 | return &cacheAddResponse{}, err
35 | }
36 |
37 | type cacheQueryRequest struct {
38 | Q string `json:"q" query:"q"`
39 | E bool `json:"e" query:"e"`
40 | }
41 |
42 | type cacheQueryResponse struct {
43 | Body []chromem.Result
44 | }
45 |
46 | func (a *Service) cacheQuery(ctx context.Context, req *cacheQueryRequest) (*cacheQueryResponse, error) {
47 | docs, err := a.cache.Query(ctx, req.Q)
48 | if err != nil {
49 | return nil, err
50 | }
51 |
52 | if !req.E {
53 | for i := range docs {
54 | docs[i].Embedding = nil
55 | }
56 | }
57 |
58 | return &cacheQueryResponse{Body: docs}, err
59 | }
60 |
61 | type cacheDelRequest struct {
62 | Id string `path:"id"`
63 | }
64 |
65 | type cacheDelResponse struct {
66 | Body []chromem.Result
67 | }
68 |
69 | func (a *Service) cacheDel(ctx context.Context, req *cacheDelRequest) (*cacheDelResponse, error) {
70 | err := a.cache.Del(ctx, req.Id)
71 | if err != nil {
72 | return nil, err
73 | }
74 |
75 | return &cacheDelResponse{}, nil
76 | }
77 |
78 | func (a *Service) setupApiCache(humaApi huma.API) {
79 | huma.Register(humaApi, huma.Operation{
80 | OperationID: "apiV1CacheOpClearPost",
81 | Method: "POST",
82 | Path: "/api/v1/cache/op/clear",
83 | Description: "Clears cache content",
84 | }, a.cacheClear)
85 |
86 | huma.Register(humaApi, huma.Operation{
87 | OperationID: "apiV1CacheGet",
88 | Method: "GET",
89 | Path: "/api/v1/cache",
90 | Description: "Queries cache",
91 | }, a.cacheQuery)
92 |
93 | huma.Register(humaApi, huma.Operation{
94 | OperationID: "apiV1CachePost",
95 | Method: "POST",
96 | Path: "/api/v1/cache",
97 | Description: "Adds entry to cache",
98 | }, a.cacheAdd)
99 |
100 | huma.Register(humaApi, huma.Operation{
101 | OperationID: "apiV1CacheDelete",
102 | Method: "DELETE",
103 | Path: "/api/v1/cache/{id}",
104 | Description: "Dels entry from cache",
105 | }, a.cacheDel)
106 | }
107 |
--------------------------------------------------------------------------------
/cmd/api/api/api.go:
--------------------------------------------------------------------------------
1 | package api
2 |
3 | import (
4 | "context"
5 | _ "embed"
6 | "log/slog"
7 | "net/http"
8 | "time"
9 |
10 | "github.com/danielgtaylor/huma/v2"
11 | "github.com/danielgtaylor/huma/v2/adapters/humago"
12 |
13 | "go.opentelemetry.io/otel/attribute"
14 | "go.opentelemetry.io/otel/metric"
15 |
16 | "gophercon-2025/cmd/api/cache"
17 | "gophercon-2025/cmd/api/llm"
18 | "gophercon-2025/cmd/api/rag"
19 | "gophercon-2025/cmd/api/telemetry"
20 | )
21 |
22 | type Service struct {
23 | llm *llm.Service
24 | rag *rag.Service
25 | cache *cache.Service
26 | model string
27 |
28 | metricResponseTime metric.Float64Counter
29 | }
30 |
31 | type Option func(*Service)
32 |
33 | func WithModel(model string) Option {
34 | return func(service *Service) {
35 | service.model = model
36 | }
37 | }
38 |
39 | func WithRag(rag *rag.Service) Option {
40 | return func(service *Service) {
41 | service.rag = rag
42 | }
43 | }
44 |
45 | func WithCache(cache *cache.Service) Option {
46 | return func(service *Service) {
47 | service.cache = cache
48 | }
49 | }
50 |
51 | func WithLlm(l *llm.Service) Option {
52 | return func(service *Service) {
53 | service.llm = l
54 | }
55 | }
56 |
57 | func (a *Service) middlewareTrace(hctx huma.Context, next func(huma.Context)) {
58 | opid := hctx.Operation().OperationID
59 |
60 | ctx, span := telemetry.Tracer.Start(hctx.Context(), opid)
61 | hctx = huma.WithContext(hctx, ctx)
62 |
63 | start := time.Now()
64 | defer func() {
65 | dur := time.Since(start)
66 | a.metricResponseTime.Add(ctx, float64(dur.Seconds()), metric.WithAttributes(attribute.String("op_id", opid)))
67 | span.End()
68 | slog.Info("Route served", "op", opid, "duration", dur.String())
69 | }()
70 |
71 | next(hctx)
72 | }
73 |
74 | func (a *Service) test(_ context.Context, _ *struct{}) (*struct{ Body string }, error) {
75 | return &struct{ Body string }{Body: "Hello - I am working"}, nil
76 | }
77 |
78 | //go:embed index.html
79 | var indexHtml []byte
80 |
81 | func New(opt ...Option) http.Handler {
82 | service := &Service{}
83 |
84 | for _, opt := range opt {
85 | opt(service)
86 | }
87 |
88 | mux := http.NewServeMux()
89 |
90 | humaApi := humago.New(mux, huma.DefaultConfig("gophercon-2025", "1.0.0"))
91 | humaApi.UseMiddleware(service.middlewareTrace)
92 |
93 | huma.Register(humaApi, huma.Operation{
94 | OperationID: "apiV1TestGet",
95 | Method: "GET",
96 | Path: "/api/v1/test",
97 | Description: "Checks API General Availability",
98 | }, service.test)
99 |
100 | service.setupApiRag(humaApi)
101 | service.setupApiStatus(humaApi)
102 | service.setupApiLlm(humaApi)
103 | service.setupApiCache(humaApi)
104 |
105 | var err error
106 |
107 | service.metricResponseTime, err = telemetry.Meter.Float64Counter("response_time_sec")
108 | if err != nil {
109 | panic(err)
110 | }
111 |
112 | mux.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
113 | writer.Write(indexHtml) //nolint:errcheck
114 | })
115 |
116 | return mux
117 | }
118 |
--------------------------------------------------------------------------------
/go.mod:
--------------------------------------------------------------------------------
1 | module gophercon-2025
2 |
3 | go 1.24.2
4 |
5 | require (
6 | github.com/danielgtaylor/huma/v2 v2.32.0
7 | github.com/google/uuid v1.6.0
8 | github.com/lib/pq v1.10.9
9 | github.com/ollama/ollama v0.6.6
10 | github.com/philippgille/chromem-go v0.7.0
11 | github.com/pressly/goose/v3 v3.24.2
12 | github.com/stretchr/testify v1.10.0
13 | github.com/sugarme/tokenizer v0.2.2
14 | github.com/urfave/cli/v3 v3.1.1
15 | go.opentelemetry.io/contrib/bridges/otelslog v0.10.0
16 | go.opentelemetry.io/otel v1.35.0
17 | go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0
18 | go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0
19 | go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0
20 | go.opentelemetry.io/otel/log v0.11.0
21 | go.opentelemetry.io/otel/metric v1.35.0
22 | go.opentelemetry.io/otel/sdk v1.35.0
23 | go.opentelemetry.io/otel/sdk/log v0.11.0
24 | go.opentelemetry.io/otel/sdk/metric v1.35.0
25 | go.opentelemetry.io/otel/trace v1.35.0
26 | gorgonia.org/gorgonia v0.9.18
27 | gorgonia.org/tensor v0.9.24
28 | )
29 |
30 | require (
31 | github.com/apache/arrow/go/arrow v0.0.0-20211112161151-bc219186db40 // indirect
32 | github.com/awalterschulze/gographviz v2.0.3+incompatible // indirect
33 | github.com/cenkalti/backoff/v4 v4.3.0 // indirect
34 | github.com/chewxy/hm v1.0.0 // indirect
35 | github.com/chewxy/math32 v1.11.0 // indirect
36 | github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
37 | github.com/emirpasic/gods v1.12.0 // indirect
38 | github.com/go-logr/logr v1.4.2 // indirect
39 | github.com/go-logr/stdr v1.2.2 // indirect
40 | github.com/gogo/protobuf v1.3.2 // indirect
41 | github.com/golang/protobuf v1.5.4 // indirect
42 | github.com/google/flatbuffers v24.3.25+incompatible // indirect
43 | github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 // indirect
44 | github.com/leesper/go_rng v0.0.0-20190531154944-a612b043e353 // indirect
45 | github.com/mfridman/interpolate v0.0.2 // indirect
46 | github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
47 | github.com/pkg/errors v0.9.1 // indirect
48 | github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
49 | github.com/rivo/uniseg v0.4.7 // indirect
50 | github.com/schollz/progressbar/v2 v2.15.0 // indirect
51 | github.com/sethvargo/go-retry v0.3.0 // indirect
52 | github.com/sugarme/regexpset v0.0.0-20200920021344-4d4ec8eaf93c // indirect
53 | github.com/xtgo/set v1.0.0 // indirect
54 | go.opentelemetry.io/auto/sdk v1.1.0 // indirect
55 | go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect
56 | go.opentelemetry.io/proto/otlp v1.5.0 // indirect
57 | go.uber.org/multierr v1.11.0 // indirect
58 | go4.org/unsafe/assume-no-moving-gc v0.0.0-20231121144256-b99613f794b6 // indirect
59 | golang.org/x/net v0.38.0 // indirect
60 | golang.org/x/sync v0.13.0 // indirect
61 | golang.org/x/sys v0.31.0 // indirect
62 | golang.org/x/text v0.24.0 // indirect
63 | golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect
64 | gonum.org/v1/gonum v0.15.0 // indirect
65 | google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e // indirect
66 | google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e // indirect
67 | google.golang.org/grpc v1.71.0 // indirect
68 | google.golang.org/protobuf v1.36.6 // indirect
69 | gopkg.in/yaml.v3 v3.0.1 // indirect
70 | gorgonia.org/cu v0.9.4 // indirect
71 | gorgonia.org/dawson v1.2.0 // indirect
72 | gorgonia.org/vecf32 v0.9.0 // indirect
73 | gorgonia.org/vecf64 v0.9.0 // indirect
74 | )
75 |
--------------------------------------------------------------------------------
/cmd/api/rag/rag.go:
--------------------------------------------------------------------------------
1 | package rag
2 |
3 | import (
4 | "context"
5 | "errors"
6 |
7 | "github.com/google/uuid"
8 | "github.com/philippgille/chromem-go"
9 | "go.opentelemetry.io/otel/attribute"
10 | "go.opentelemetry.io/otel/trace"
11 | )
12 |
13 | const (
14 | ColletionNameRag = "rag"
15 | EmbeddingModel = "nomic-embed-text"
16 | DefaultOllamaEndpoint = ""
17 | )
18 |
19 | var defaultEmbeddingFunc = chromem.NewEmbeddingFuncOllama(EmbeddingModel, DefaultOllamaEndpoint)
20 |
21 | type Service struct {
22 | db *chromem.DB
23 | tracer trace.Tracer
24 |
25 | embModel string
26 | llmEp string
27 | }
28 |
29 | type Option func(*Service)
30 |
31 | func WithDBName(dbPath string) Option {
32 | if dbPath == "" {
33 | panic("dbPath is empty")
34 | }
35 |
36 | return func(s *Service) {
37 | db, err := chromem.NewPersistentDB(dbPath, true)
38 | if err != nil {
39 | panic(err)
40 | }
41 |
42 | s.db = db
43 | }
44 | }
45 |
46 | func WithDb(db *chromem.DB) Option {
47 | return func(s *Service) {
48 | s.db = db
49 | }
50 | }
51 |
52 | func WithEmbModel(model string) Option {
53 | return func(s *Service) {
54 | s.embModel = model
55 | }
56 | }
57 |
58 | func WithTracer(tracer trace.Tracer) Option {
59 | return func(s *Service) {
60 | s.tracer = tracer
61 | }
62 | }
63 |
64 | func WithOllamaEndpoint(endpoint string) Option {
65 | return func(s *Service) {
66 | s.llmEp = endpoint
67 | }
68 | }
69 |
70 | func (r *Service) Add(ctx context.Context, fact string, meta map[string]string) (err error) {
71 | ctx, span := r.tracer.Start(ctx, "rag.Add")
72 | defer func() {
73 | span.RecordError(err)
74 | span.End()
75 | }()
76 |
77 | err = r.collection().AddDocument(ctx, chromem.Document{
78 | ID: uuid.NewString(),
79 | Metadata: meta,
80 | Content: fact,
81 | })
82 |
83 | return err
84 | }
85 |
86 | func (r *Service) Clear(ctx context.Context) (err error) {
87 | _, span := r.tracer.Start(ctx, "rag.Clear")
88 | defer func() {
89 | span.RecordError(err)
90 | span.End()
91 | }()
92 |
93 | err = r.db.DeleteCollection(ColletionNameRag)
94 |
95 | return err
96 | }
97 |
98 | func (r *Service) Query(ctx context.Context, s string) (ret []chromem.Result, err error) {
99 | ctx, span := r.tracer.Start(ctx, "rag.Query", trace.WithAttributes(attribute.String("query", s)))
100 | defer func() {
101 | span.RecordError(err)
102 | span.End()
103 | }()
104 |
105 | if r.collection().Count() < 1 {
106 | return nil, nil
107 | }
108 |
109 | nresults := 25
110 | if nresults > r.collection().Count() {
111 | nresults = r.collection().Count()
112 | }
113 |
114 | ret, err = r.collection().Query(ctx, s, nresults, nil, nil)
115 |
116 | return ret, err
117 | }
118 |
119 | func (r *Service) Del(ctx context.Context, id string) (err error) {
120 | ctx, span := r.tracer.Start(ctx, "rag.Del")
121 | defer func() {
122 | span.RecordError(err)
123 | span.End()
124 | }()
125 |
126 | err = r.collection().Delete(ctx, nil, nil, id)
127 |
128 | return err
129 | }
130 |
131 | func (r *Service) collection() *chromem.Collection {
132 | col := r.db.GetCollection(ColletionNameRag, defaultEmbeddingFunc)
133 | if col == nil {
134 | var err error
135 | col, err = r.db.CreateCollection(ColletionNameRag, nil, defaultEmbeddingFunc)
136 |
137 | if err != nil {
138 | panic(err)
139 | }
140 | }
141 |
142 | return col
143 | }
144 |
145 | func New(opts ...Option) (ret *Service, err error) {
146 | ret = &Service{}
147 |
148 | for _, opt := range opts {
149 | opt(ret)
150 | }
151 |
152 | defaultEmbeddingFunc = chromem.NewEmbeddingFuncOllama(ret.embModel, ret.llmEp+"/api")
153 |
154 | if ret.db == nil {
155 | return nil, errors.New("db was not initialized")
156 | }
157 |
158 | return ret, nil
159 | }
160 |
--------------------------------------------------------------------------------
/cmd/api/cache/cache.go:
--------------------------------------------------------------------------------
1 | package cache
2 |
3 | import (
4 | "context"
5 | "errors"
6 | "strings"
7 |
8 | "github.com/google/uuid"
9 | "github.com/philippgille/chromem-go"
10 | "go.opentelemetry.io/otel/attribute"
11 | "go.opentelemetry.io/otel/trace"
12 | )
13 |
14 | const (
15 | ColletionNameRag = "cache"
16 | EmbeddingModel = "nomic-embed-text"
17 | DefaultOllamaEndpoint = ""
18 | )
19 |
20 | var defaultEmbeddingFunc = chromem.NewEmbeddingFuncOllama(EmbeddingModel, DefaultOllamaEndpoint)
21 |
22 | type Service struct {
23 | db *chromem.DB
24 | tracer trace.Tracer
25 |
26 | embModel string
27 | llmEp string
28 | }
29 |
30 | type Option func(*Service)
31 |
32 | func WithDb(db *chromem.DB) Option {
33 | return func(s *Service) {
34 | s.db = db
35 | }
36 | }
37 |
38 | func WithEmbModel(model string) Option {
39 | return func(s *Service) {
40 | s.embModel = model
41 | }
42 | }
43 |
44 | func WithOllamaEndpoint(endpoint string) Option {
45 | return func(s *Service) {
46 | s.llmEp = endpoint
47 | }
48 | }
49 |
50 | func WithTracer(tracer trace.Tracer) Option {
51 | return func(s *Service) {
52 | s.tracer = tracer
53 | }
54 | }
55 |
56 | func (r *Service) Add(ctx context.Context, fact string, response, meta string) (err error) {
57 | ctx, span := r.tracer.Start(ctx, "cache.Add")
58 | defer func() {
59 | span.RecordError(err)
60 | span.End()
61 | }()
62 |
63 | metaMap := map[string]string{
64 | "RESPONSE": response,
65 | }
66 |
67 | entries := strings.Split(meta, ",")
68 |
69 | for _, entry := range entries {
70 | kv := strings.Split(entry, ":")
71 | if len(kv) != 2 || kv[0] == "RESPONSE" {
72 | continue
73 | }
74 |
75 | metaMap[kv[0]] = kv[1]
76 | }
77 |
78 | err = r.collection().AddDocument(ctx, chromem.Document{
79 | ID: uuid.NewString(),
80 | Metadata: metaMap,
81 | Content: fact,
82 | })
83 |
84 | return err
85 | }
86 |
87 | func (r *Service) Clear(ctx context.Context) (err error) {
88 | _, span := r.tracer.Start(ctx, "cache.Clear")
89 | defer func() {
90 | span.RecordError(err)
91 | span.End()
92 | }()
93 |
94 | err = r.db.DeleteCollection(ColletionNameRag)
95 |
96 | return err
97 | }
98 |
99 | func (r *Service) Query(ctx context.Context, s string) (ret []chromem.Result, err error) {
100 | ctx, span := r.tracer.Start(ctx, "cache.Query", trace.WithAttributes(attribute.String("query", s)))
101 | defer func() {
102 | span.RecordError(err)
103 | span.End()
104 | }()
105 |
106 | if r.collection().Count() < 1 {
107 | return nil, nil
108 | }
109 |
110 | nresults := 25
111 | if nresults > r.collection().Count() {
112 | nresults = r.collection().Count()
113 | }
114 |
115 | ret, err = r.collection().Query(ctx, s, nresults, nil, nil)
116 |
117 | return ret, err
118 | }
119 |
120 | func (r *Service) Del(ctx context.Context, id string) (err error) {
121 | ctx, span := r.tracer.Start(ctx, "cache.Del")
122 | defer func() {
123 | span.RecordError(err)
124 | span.End()
125 | }()
126 |
127 | err = r.collection().Delete(ctx, nil, nil, id)
128 |
129 | return err
130 | }
131 |
132 | func (r *Service) collection() *chromem.Collection {
133 | col := r.db.GetCollection(ColletionNameRag, defaultEmbeddingFunc)
134 | if col == nil {
135 | var err error
136 |
137 | col, err = r.db.CreateCollection(ColletionNameRag, nil, defaultEmbeddingFunc)
138 | if err != nil {
139 | panic(err)
140 | }
141 | }
142 |
143 | return col
144 | }
145 |
146 | func New(opts ...Option) (ret *Service, err error) {
147 | ret = &Service{}
148 |
149 | for _, opt := range opts {
150 | opt(ret)
151 | }
152 |
153 | if ret.db == nil {
154 | return nil, errors.New("db was not initialized")
155 | }
156 |
157 | defaultEmbeddingFunc = chromem.NewEmbeddingFuncOllama(ret.embModel, ret.llmEp+"/api")
158 |
159 | return ret, nil
160 | }
161 |
--------------------------------------------------------------------------------
/cmd/api/flags.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log/slog"
5 |
6 | "github.com/urfave/cli/v3"
7 | )
8 |
9 | type flags struct {
10 | listeningAddr string
11 | vecDbPath string
12 | llmModel string
13 | embModel string
14 | minConfidenceRag float64
15 | minConfidenceTool float64
16 | minConfidenceCache float64
17 | temperature float64
18 | toolDb string
19 |
20 | tokenizerModel string
21 | tokenizerCache string
22 |
23 | slogLevel string
24 | otelEp string
25 | llmEp string
26 | }
27 |
28 | func (f *flags) SlogLevel() slog.Level {
29 | switch f.slogLevel {
30 | case "debug":
31 | return slog.LevelDebug
32 | case "info":
33 | return slog.LevelInfo
34 | case "warn":
35 | return slog.LevelWarn
36 | case "error":
37 | return slog.LevelError
38 | default:
39 | return slog.LevelError
40 | }
41 | }
42 |
43 | func (f *flags) build() []cli.Flag {
44 | return []cli.Flag{
45 | &cli.StringFlag{
46 | Name: "listening-addr",
47 | Value: ":8080",
48 | Destination: &f.listeningAddr,
49 | DefaultText: ":8080",
50 | Sources: cli.EnvVars("ADDR"),
51 | },
52 | &cli.StringFlag{
53 | Name: "db",
54 | Value: "./db",
55 | Destination: &f.vecDbPath,
56 | DefaultText: "./db",
57 | Sources: cli.EnvVars("VEC_DB"),
58 | },
59 | &cli.StringFlag{
60 | Name: "emb-model",
61 | Value: "nomic-embed-text",
62 | Destination: &f.embModel,
63 | DefaultText: "nomic-embed-text",
64 | Sources: cli.EnvVars("EMB_MODEL"),
65 | },
66 | &cli.StringFlag{
67 | Name: "llm-model",
68 | Value: "gemma3",
69 | Destination: &f.llmModel,
70 | DefaultText: "gemma3",
71 | Sources: cli.EnvVars("LLM_MODEL"),
72 | },
73 | &cli.FloatFlag{
74 | Name: "min-confidence-rag",
75 | Value: 0.80,
76 | Destination: &f.minConfidenceRag,
77 | DefaultText: "0.5",
78 | Sources: cli.EnvVars("MIN_CONFIDENCE_RAG"),
79 | },
80 | &cli.FloatFlag{
81 | Name: "min-confidence-tool",
82 | Value: 0.60,
83 | Destination: &f.minConfidenceTool,
84 | DefaultText: "0.6",
85 | Sources: cli.EnvVars("MIN_CONFIDENCE_TOOL"),
86 | },
87 | &cli.FloatFlag{
88 | Name: "min-confidence-cache",
89 | Value: 0.9,
90 | Destination: &f.minConfidenceCache,
91 | DefaultText: "0.9",
92 | Sources: cli.EnvVars("MIN_CONFIDENCE_CACHE"),
93 | },
94 | &cli.FloatFlag{
95 | Name: "temperature",
96 | Value: 0.5,
97 | Destination: &f.temperature,
98 | DefaultText: "0.5",
99 | Sources: cli.EnvVars("TEMPERATURE"),
100 | },
101 | &cli.StringFlag{
102 | Name: "slog-level",
103 | Value: "info",
104 | Destination: &f.slogLevel,
105 | DefaultText: "info",
106 | Sources: cli.EnvVars("SLOG_LEVEL"),
107 | },
108 | &cli.StringFlag{
109 | Name: "otel-ep",
110 | Value: "",
111 | Destination: &f.otelEp,
112 | DefaultText: "",
113 | Sources: cli.EnvVars("OTEL_ENDPOINT"),
114 | },
115 | &cli.StringFlag{
116 | Name: "tokenizer-model",
117 | Value: "bert-base-uncased",
118 | Destination: &f.tokenizerModel,
119 | DefaultText: "bert-base-uncased",
120 | Sources: cli.EnvVars("TOKENIZER_MODEL"),
121 | },
122 | &cli.StringFlag{
123 | Name: "tokenizer-cache",
124 | Value: "./data/tokenizer.json",
125 | Destination: &f.tokenizerCache,
126 | DefaultText: "./data/tokenizer.json",
127 | Sources: cli.EnvVars("TOKENIZER_CACHE"),
128 | },
129 | &cli.StringFlag{
130 | Name: "tool-db",
131 | Value: "./data/db.sqlite",
132 | Destination: &f.toolDb,
133 | DefaultText: "./data/db.sqlite",
134 | Sources: cli.EnvVars("TOOL_DB"),
135 | },
136 | &cli.StringFlag{
137 | Name: "llm-ep",
138 | Value: "localhost:11434",
139 | Destination: &f.llmEp,
140 | DefaultText: "localhost:11434",
141 | Sources: cli.EnvVars("LLM_ENDPOINT"),
142 | },
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/deploy/grafana/dashboards/files/tokens.json:
--------------------------------------------------------------------------------
1 | {
2 | "annotations": {
3 | "list": [
4 | {
5 | "builtIn": 1,
6 | "datasource": {
7 | "type": "grafana",
8 | "uid": "-- Grafana --"
9 | },
10 | "enable": true,
11 | "hide": true,
12 | "iconColor": "rgba(0, 211, 255, 1)",
13 | "name": "Annotations & Alerts",
14 | "type": "dashboard"
15 | }
16 | ]
17 | },
18 | "editable": true,
19 | "fiscalYearStartMonth": 0,
20 | "graphTooltip": 0,
21 | "id": 1,
22 | "links": [],
23 | "panels": [
24 | {
25 | "datasource": {
26 | "type": "prometheus",
27 | "uid": "prometheus"
28 | },
29 | "fieldConfig": {
30 | "defaults": {
31 | "color": {
32 | "mode": "palette-classic"
33 | },
34 | "custom": {
35 | "axisBorderShow": false,
36 | "axisCenteredZero": false,
37 | "axisColorMode": "text",
38 | "axisLabel": "",
39 | "axisPlacement": "auto",
40 | "barAlignment": 0,
41 | "barWidthFactor": 0.6,
42 | "drawStyle": "line",
43 | "fillOpacity": 0,
44 | "gradientMode": "none",
45 | "hideFrom": {
46 | "legend": false,
47 | "tooltip": false,
48 | "viz": false
49 | },
50 | "insertNulls": false,
51 | "lineInterpolation": "linear",
52 | "lineWidth": 1,
53 | "pointSize": 5,
54 | "scaleDistribution": {
55 | "type": "linear"
56 | },
57 | "showPoints": "auto",
58 | "spanNulls": false,
59 | "stacking": {
60 | "group": "A",
61 | "mode": "none"
62 | },
63 | "thresholdsStyle": {
64 | "mode": "off"
65 | }
66 | },
67 | "mappings": [],
68 | "thresholds": {
69 | "mode": "absolute",
70 | "steps": [
71 | {
72 | "color": "green"
73 | },
74 | {
75 | "color": "red",
76 | "value": 80
77 | }
78 | ]
79 | }
80 | },
81 | "overrides": []
82 | },
83 | "gridPos": {
84 | "h": 8,
85 | "w": 12,
86 | "x": 0,
87 | "y": 0
88 | },
89 | "id": 1,
90 | "options": {
91 | "legend": {
92 | "calcs": [],
93 | "displayMode": "list",
94 | "placement": "bottom",
95 | "showLegend": true
96 | },
97 | "tooltip": {
98 | "hideZeros": false,
99 | "mode": "single",
100 | "sort": "none"
101 | }
102 | },
103 | "pluginVersion": "11.6.0",
104 | "targets": [
105 | {
106 | "datasource": {
107 | "type": "prometheus",
108 | "uid": "prometheus"
109 | },
110 | "disableTextWrap": false,
111 | "editorMode": "builder",
112 | "expr": "tokens_in_llm_total",
113 | "fullMetaSearch": false,
114 | "includeNullMetadata": true,
115 | "instant": false,
116 | "legendFormat": "__auto",
117 | "range": true,
118 | "refId": "A",
119 | "useBackend": false
120 | },
121 | {
122 | "datasource": {
123 | "type": "prometheus",
124 | "uid": "prometheus"
125 | },
126 | "disableTextWrap": false,
127 | "editorMode": "builder",
128 | "expr": "tokens_out_llm_total",
129 | "fullMetaSearch": false,
130 | "hide": false,
131 | "includeNullMetadata": true,
132 | "instant": false,
133 | "legendFormat": "__auto",
134 | "range": true,
135 | "refId": "B",
136 | "useBackend": false
137 | }
138 | ],
139 | "title": "Tokens",
140 | "type": "timeseries"
141 | }
142 | ],
143 | "preload": false,
144 | "schemaVersion": 41,
145 | "tags": [],
146 | "templating": {
147 | "list": []
148 | },
149 | "time": {
150 | "from": "now-6h",
151 | "to": "now"
152 | },
153 | "timepicker": {},
154 | "timezone": "browser",
155 | "title": "Tokens",
156 | "uid": "dejlig0kgrnk0c",
157 | "version": 1
158 | }
--------------------------------------------------------------------------------
/cmd/api/telemetry/otel.go:
--------------------------------------------------------------------------------
1 | package telemetry
2 |
3 | import (
4 | "context"
5 | "errors"
6 | "log/slog"
7 | "os"
8 | "time"
9 |
10 | "go.opentelemetry.io/contrib/bridges/otelslog"
11 | "go.opentelemetry.io/otel"
12 | "go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc"
13 | "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc"
14 | "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
15 | "go.opentelemetry.io/otel/log/global"
16 | "go.opentelemetry.io/otel/metric"
17 | "go.opentelemetry.io/otel/propagation"
18 | sdklog "go.opentelemetry.io/otel/sdk/log"
19 | sdkmetric "go.opentelemetry.io/otel/sdk/metric"
20 | sdkresource "go.opentelemetry.io/otel/sdk/resource"
21 | sdktrace "go.opentelemetry.io/otel/sdk/trace"
22 | semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
23 | "go.opentelemetry.io/otel/trace"
24 | )
25 |
26 | var (
27 | Meter metric.Meter
28 | Tracer trace.Tracer
29 | Logger *slog.Logger
30 | )
31 |
32 | func Setup(ctx context.Context, ep string, lvl slog.Level) (shutdown func(context.Context) error, err error) {
33 | var shutdownFuncs []func(context.Context) error
34 |
35 | shutdown = func(ctx context.Context) error {
36 | var err error
37 | for _, fn := range shutdownFuncs {
38 | err = errors.Join(err, fn(ctx))
39 | }
40 |
41 | shutdownFuncs = nil
42 |
43 | return err
44 | }
45 |
46 | handleErr := func(inErr error) {
47 | err = errors.Join(inErr, shutdown(ctx))
48 | }
49 |
50 | prop := newPropagator()
51 | otel.SetTextMapPropagator(prop)
52 |
53 | tracerProvider, err := newTracerProvider(ctx, ep)
54 | if err != nil {
55 | handleErr(err)
56 |
57 | return nil, err
58 | }
59 |
60 | shutdownFuncs = append(shutdownFuncs, tracerProvider.Shutdown)
61 |
62 | otel.SetTracerProvider(tracerProvider)
63 |
64 | Tracer = otel.Tracer("llm-api")
65 |
66 | meterProvider, err := newMeterProvider(ctx, ep)
67 | if err != nil {
68 | handleErr(err)
69 |
70 | return nil, err
71 | }
72 |
73 | shutdownFuncs = append(shutdownFuncs, meterProvider.Shutdown)
74 |
75 | otel.SetMeterProvider(meterProvider)
76 |
77 | Meter = otel.Meter("llm-api")
78 |
79 | loggerProvider, err := newLoggerProvider(ctx, ep)
80 | if err != nil {
81 | handleErr(err)
82 |
83 | return nil, err
84 | }
85 |
86 | shutdownFuncs = append(shutdownFuncs, loggerProvider.Shutdown)
87 |
88 | global.SetLoggerProvider(loggerProvider)
89 |
90 | otelHandler := otelslog.NewHandler("llm-api")
91 | stdoutHandler := slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
92 | AddSource: true,
93 | Level: lvl,
94 | ReplaceAttr: nil,
95 | })
96 |
97 | tHandler := &teeLogHandler{handlers: []slog.Handler{otelHandler, stdoutHandler}}
98 |
99 | Logger = slog.New(tHandler)
100 |
101 | slog.SetDefault(Logger)
102 |
103 | return shutdown, nil
104 | }
105 |
106 | //nolint:ireturn
107 | func newPropagator() propagation.TextMapPropagator {
108 | return propagation.NewCompositeTextMapPropagator(
109 | propagation.TraceContext{},
110 | propagation.Baggage{},
111 | )
112 | }
113 |
114 | func newTracerProvider(ctx context.Context, ep string) (*sdktrace.TracerProvider, error) {
115 | exporter, err := otlptracegrpc.New(ctx,
116 | otlptracegrpc.WithInsecure(), // Only for testing or internal networks
117 | otlptracegrpc.WithEndpoint(ep),
118 | )
119 | if err != nil {
120 | return nil, err
121 | }
122 |
123 | tp := sdktrace.NewTracerProvider(
124 | sdktrace.WithBatcher(exporter),
125 | sdktrace.WithResource(sdkresource.NewWithAttributes(
126 | semconv.SchemaURL,
127 | semconv.ServiceName("llm-api"),
128 | )),
129 | )
130 |
131 | return tp, nil
132 | }
133 |
134 | func newMeterProvider(ctx context.Context, ep string) (*sdkmetric.MeterProvider, error) {
135 | exporter, err := otlpmetricgrpc.New(
136 | ctx,
137 | otlpmetricgrpc.WithInsecure(),
138 | otlpmetricgrpc.WithEndpoint(ep),
139 | )
140 | if err != nil {
141 | return nil, err
142 | }
143 |
144 | mp := sdkmetric.NewMeterProvider(
145 | sdkmetric.WithReader(sdkmetric.NewPeriodicReader(exporter,
146 | sdkmetric.WithInterval(3*time.Second)),
147 | ),
148 | sdkmetric.WithResource(sdkresource.NewWithAttributes(
149 | semconv.SchemaURL,
150 | semconv.ServiceName("llm-api"),
151 | )),
152 | )
153 |
154 | return mp, nil
155 | }
156 |
157 | func newLoggerProvider(ctx context.Context, ep string) (*sdklog.LoggerProvider, error) {
158 | exporter, err := otlploggrpc.New(ctx, otlploggrpc.WithInsecure(), otlploggrpc.WithEndpoint(ep))
159 | if err != nil {
160 | return nil, err
161 | }
162 |
163 | loggerProvider := sdklog.NewLoggerProvider(
164 | sdklog.WithProcessor(sdklog.NewBatchProcessor(exporter)),
165 | sdklog.WithResource(sdkresource.NewWithAttributes(
166 | semconv.SchemaURL,
167 | semconv.ServiceName("llm-api"),
168 | )),
169 | )
170 |
171 | return loggerProvider, nil
172 | }
173 |
--------------------------------------------------------------------------------
/cmd/api/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "context"
5 | "database/sql"
6 | "errors"
7 | "log/slog"
8 | "net"
9 | "net/http"
10 | "net/url"
11 | "os"
12 | "os/signal"
13 | "syscall"
14 | "time"
15 |
16 | _ "github.com/lib/pq"
17 | ollama_api "github.com/ollama/ollama/api"
18 | "github.com/philippgille/chromem-go"
19 | "github.com/urfave/cli/v3"
20 | "go.opentelemetry.io/otel"
21 |
22 | "gophercon-2025/cmd/api/api"
23 | "gophercon-2025/cmd/api/cache"
24 | "gophercon-2025/cmd/api/env"
25 | "gophercon-2025/cmd/api/llm"
26 | "gophercon-2025/cmd/api/rag"
27 | "gophercon-2025/cmd/api/telemetry"
28 | "gophercon-2025/cmd/api/tokenizer"
29 | "gophercon-2025/cmd/api/tool"
30 | )
31 |
32 | func run(ctx context.Context, f *flags) (err error) {
33 | otelShutdown, err := telemetry.Setup(ctx, f.otelEp, f.SlogLevel())
34 | if err != nil {
35 | return err
36 | }
37 |
38 | defer func() {
39 | err = errors.Join(err, otelShutdown(context.Background()))
40 | }()
41 |
42 | slog.SetDefault(telemetry.Logger)
43 |
44 | _, span := telemetry.Tracer.Start(ctx, "startup")
45 |
46 | vecDb, err := chromem.NewPersistentDB(f.vecDbPath, true)
47 | if err != nil {
48 | panic(err)
49 | }
50 |
51 | db, err := sql.Open("postgres", f.toolDb)
52 | if err != nil {
53 | return err
54 | }
55 | defer db.Close()
56 |
57 | rs, err := db.Query("select version()")
58 | if err != nil {
59 | return err
60 | }
61 | defer rs.Close()
62 |
63 | if rs.Err() != nil {
64 | return err
65 | }
66 |
67 | if !rs.Next() {
68 | return errors.New("could not retrieve db version")
69 | }
70 |
71 | var dbVersion string
72 | if err = rs.Scan(&dbVersion); err != nil {
73 | return err
74 | }
75 |
76 | slog.Info("Using tool db", "version", dbVersion)
77 |
78 | toolSvc := tool.New(
79 | tool.WithDb(db),
80 | tool.WithTracer(telemetry.Tracer),
81 | )
82 |
83 | l, err := net.Listen("tcp", f.listeningAddr)
84 | if err != nil {
85 | return err
86 | }
87 |
88 | ragService, err := rag.New(
89 | rag.WithDb(vecDb),
90 | rag.WithEmbModel(f.embModel),
91 | rag.WithTracer(telemetry.Tracer),
92 | rag.WithOllamaEndpoint(f.llmEp),
93 | )
94 | if err != nil {
95 | return err
96 | }
97 |
98 | cacheService, err := cache.New(
99 | cache.WithDb(vecDb),
100 | cache.WithEmbModel(f.embModel),
101 | cache.WithTracer(telemetry.Tracer),
102 | cache.WithOllamaEndpoint(f.llmEp),
103 | )
104 |
105 | tokenizerService := tokenizer.New(
106 | tokenizer.WithPretrainedFromCache(f.tokenizerModel, f.tokenizerCache),
107 | )
108 |
109 | llmUrl, err := url.Parse(f.llmEp)
110 | if err != nil {
111 | return err
112 | }
113 |
114 | client := ollama_api.NewClient(llmUrl, http.DefaultClient)
115 |
116 | ver, err := client.Version(ctx)
117 | if err != nil {
118 | return err
119 | }
120 |
121 | slog.Info("Llm Connected", "ver", ver)
122 |
123 | llmService := llm.New(
124 | llm.WithCache(cacheService),
125 | llm.WithLlmModel(f.llmModel),
126 | llm.WithLogger(telemetry.Logger),
127 | llm.WithMinConfidenceRag(f.minConfidenceRag),
128 | llm.WithMinConfidenceTool(f.minConfidenceTool),
129 | llm.WithMinConfidenceCache(f.minConfidenceCache),
130 | llm.WithOllama(client),
131 | llm.WithRag(ragService),
132 | llm.WithTemperature(f.temperature),
133 | llm.WithTokenizer(tokenizerService),
134 | llm.WithTracer(telemetry.Tracer),
135 | llm.WithMetrics(telemetry.Meter),
136 | llm.WithTool(toolSvc),
137 | )
138 |
139 | mux := api.New(
140 | api.WithLlm(llmService),
141 | api.WithModel(f.llmModel),
142 | api.WithRag(ragService),
143 | api.WithCache(cacheService),
144 | )
145 |
146 | server := &http.Server{
147 | Handler: mux,
148 | ReadTimeout: 10 * time.Minute,
149 | WriteTimeout: 10 * time.Minute,
150 | IdleTimeout: 10 * time.Minute,
151 | }
152 |
153 | go func() {
154 | <-ctx.Done()
155 |
156 | if closeErr := server.Close(); closeErr != nil {
157 | slog.Warn("failed to close http server", "err", closeErr)
158 | }
159 | }()
160 |
161 | slog.Info("starting server")
162 |
163 | metricUp, err := otel.Meter("llm-api").Int64Gauge("up")
164 | if err != nil {
165 | return err
166 | }
167 |
168 | metricUp.Record(ctx, 1)
169 |
170 | defer func() {
171 | metricUp.Record(ctx, 0)
172 | }()
173 |
174 | span.End()
175 |
176 | slog.Info("Server up and running ", "addr", l.Addr().String())
177 |
178 | err = server.Serve(l)
179 | if errors.Is(err, http.ErrServerClosed) {
180 | return nil
181 | }
182 |
183 | return err
184 | }
185 |
186 | func main() {
187 | ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
188 | defer cancel()
189 |
190 | env.Load("api")
191 |
192 | f := &flags{}
193 |
194 | if err := (&cli.Command{
195 | Name: "api",
196 | Usage: "Start the api server",
197 | Flags: f.build(),
198 | Action: func(ctx context.Context, command *cli.Command) error {
199 | return run(ctx, f)
200 | },
201 | }).Run(ctx, os.Args); err != nil {
202 | panic(err)
203 | }
204 |
205 | slog.Info("shutdown complete")
206 | }
207 |
--------------------------------------------------------------------------------
/cmd/neuro-net-class/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | "strings"
6 | "unicode"
7 |
8 | "gorgonia.org/gorgonia"
9 | "gorgonia.org/tensor"
10 | )
11 |
12 | // vocab é Vocabulario. Define que tokens considerar e ignorar.
13 | var vocab = []string{
14 | "ligar", "desligar", "acender", "apagar",
15 | "luz", "ventilador", "ar", "condicionado",
16 | "como", "está", "temperatura", "hoje", "agora",
17 | }
18 |
19 | // classNames são as classes que desejamos utilizar para classificar sentenças.
20 | var classNames = []string{
21 | "comando_ligar",
22 | "comando_desligar",
23 | "comando_consulta",
24 | }
25 |
26 | // trainSentences são sentenças que utilizaremos para treinar a rede.
27 | var trainSentences = []string{
28 | "ligar a luz",
29 | "acender o ventilador",
30 | "ligar o ar condicionado",
31 | "desligar a luz",
32 | "apagar o ventilador",
33 | "desligar o ar",
34 | "como está a temperatura",
35 | "qual é a temperatura agora",
36 | "me diga a temperatura de hoje",
37 | }
38 |
39 | // trainLabels - etiquetas para classificarmos nossas sentenças de treinamento.
40 | var trainLabels = []int{
41 | 0, 0, 0,
42 | 1, 1, 1,
43 | 2, 2, 2,
44 | }
45 |
46 | // wordToIndex é o indexador dos tokens.
47 | var wordToIndex = func() map[string]int {
48 | m := make(map[string]int)
49 | for i, word := range vocab {
50 | m[word] = i
51 | }
52 |
53 | return m
54 | }()
55 |
56 | // vectorize: função simples para demonstrar a vetorização.
57 | func vectorize(text string) []float32 {
58 | vec := make([]float32, len(vocab))
59 | words := strings.FieldsFunc(strings.ToLower(text), func(r rune) bool {
60 | return !unicode.IsLetter(r)
61 | })
62 |
63 | for _, word := range words {
64 | if idx, ok := wordToIndex[word]; ok {
65 | vec[idx]++
66 | }
67 | }
68 |
69 | return vec
70 | }
71 |
72 | // argmax busca o id do maior valor na slice fornecida.
73 | func argmax(vals []float32) int {
74 | maxIdx := 0
75 | maxVal := vals[0]
76 |
77 | for i, v := range vals {
78 | if v > maxVal {
79 | maxVal = v
80 | maxIdx = i
81 | }
82 | }
83 |
84 | return maxIdx
85 | }
86 |
87 | // train: aqui treinamos nossa rede, e posteriormente retornamos
88 | //
89 | // B: nó com os viezes (biases)
90 | // W: nó com os pesos para análise.
91 | func train() (biases *gorgonia.Node, weights *gorgonia.Node, err error) {
92 | numClasses := len(classNames)
93 | numSamples := len(trainSentences)
94 | inputSize := len(vocab)
95 |
96 | // Tensores de entrada e saída
97 | Xdata := make([]float32, 0, numSamples*inputSize)
98 | Ydata := make([]float32, 0, numSamples*numClasses)
99 |
100 | for i, sentence := range trainSentences {
101 | Xdata = append(Xdata, vectorize(sentence)...)
102 |
103 | for j := range numClasses {
104 | switch {
105 | case j == trainLabels[i]:
106 | Ydata = append(Ydata, 1)
107 | default:
108 | Ydata = append(Ydata, 0)
109 | }
110 | }
111 | }
112 |
113 | // tensores são estruturas de dados multidimensionais que carregam inputs e outputs em uma rede neural.
114 | Xtensor := tensor.New(tensor.WithShape(numSamples, inputSize), tensor.WithBacking(Xdata))
115 | Ytensor := tensor.New(tensor.WithShape(numSamples, numClasses), tensor.WithBacking(Ydata))
116 |
117 | // o grafo é a forma de modelar o conjunto de instruções, é o "programa" da rede neural.
118 | g := gorgonia.NewGraph()
119 |
120 | // inputs
121 | X := gorgonia.NewMatrix(g, gorgonia.Float32, gorgonia.WithShape(numSamples, inputSize), gorgonia.WithName("X"))
122 |
123 | // outputs
124 | Y := gorgonia.NewMatrix(g, gorgonia.Float32, gorgonia.WithShape(numSamples, numClasses), gorgonia.WithName("Y"))
125 |
126 | // weights é onde armazenaremos os pesos uma vez que a rede esteja treinada - compartilharemos essa matriz
127 | // com a etapa de predição.
128 | weights = gorgonia.NewMatrix(g, gorgonia.Float32, gorgonia.WithShape(inputSize, numClasses), gorgonia.WithInit(gorgonia.GlorotN(1)))
129 |
130 | // de forma análoga, armazenaremos os viezes na matriz abaixo.
131 | biases = gorgonia.NewVector(g, gorgonia.Float32, gorgonia.WithShape(numClasses), gorgonia.WithInit(gorgonia.Zeroes()))
132 |
133 | // valores brutos, não normalizados.
134 | logits := gorgonia.Must(gorgonia.BroadcastAdd(gorgonia.Must(gorgonia.Mul(X, weights)), biases, nil, []byte{0}))
135 |
136 | // valores normalizados.
137 | pred := gorgonia.Must(gorgonia.SoftMax(logits))
138 |
139 | // Calculo da perda.
140 | logPred := gorgonia.Must(gorgonia.Log(pred))
141 | mul := gorgonia.Must(gorgonia.HadamardProd(Y, logPred))
142 | sum := gorgonia.Must(gorgonia.Sum(mul))
143 | neg := gorgonia.Must(gorgonia.Neg(sum))
144 |
145 | // loss = -mean(y * log(pred))
146 | // loss é a perda, ou a distância da resposta dada em relação ao resultado esperado
147 | // menor perda => melhor resultado.
148 | loss := gorgonia.Must(gorgonia.Div(neg, gorgonia.NewConstant(float32(numSamples))))
149 |
150 | // Gradientes: indicam ao otimizador como ajustar os pesos para reduzir a perda.
151 | if _, err = gorgonia.Grad(loss, weights, biases); err != nil {
152 | return nil, nil, err
153 | }
154 |
155 | vm := gorgonia.NewTapeMachine(g, gorgonia.BindDualValues(weights, biases))
156 |
157 | // vamos usar o otimizador ADAM - ele é simples e já vem implementado.
158 | solver := gorgonia.NewAdamSolver()
159 |
160 | // Treinamento
161 | // Como ja deixamos tudo preparado, a cada passo, a perda é avaliada e
162 | // o otimizador recalibra os pesos.
163 | for range 3000 {
164 | if err = gorgonia.Let(X, Xtensor); err != nil {
165 | return nil, nil, err
166 | }
167 |
168 | if err = gorgonia.Let(Y, Ytensor); err != nil {
169 | return nil, nil, err
170 | }
171 |
172 | if err = vm.RunAll(); err != nil {
173 | return nil, nil, err
174 | }
175 |
176 | if err = solver.Step([]gorgonia.ValueGrad{weights, biases}); err != nil {
177 | return nil, nil, err
178 | }
179 |
180 | vm.Reset()
181 | }
182 |
183 | return biases, weights, nil
184 | }
185 |
186 | func predict(sentences []string, biases *gorgonia.Node, weights *gorgonia.Node) error {
187 | inputSize := len(vocab)
188 | numClasses := len(classNames)
189 |
190 | g2 := gorgonia.NewGraph()
191 | X2 := gorgonia.NewMatrix(g2, gorgonia.Float32, gorgonia.WithShape(1, inputSize), gorgonia.WithName("X2"))
192 | W2 := gorgonia.NewMatrix(g2, gorgonia.Float32, gorgonia.WithShape(inputSize, numClasses), gorgonia.WithValue(weights.Value()))
193 | B2 := gorgonia.NewVector(g2, gorgonia.Float32, gorgonia.WithShape(numClasses), gorgonia.WithValue(biases.Value()))
194 |
195 | out := gorgonia.Must(gorgonia.SoftMax(gorgonia.Must(gorgonia.Add(gorgonia.Must(gorgonia.Mul(X2, W2)), B2))))
196 |
197 | for _, sentence := range sentences {
198 | vec := vectorize(sentence)
199 | input := tensor.New(tensor.WithShape(1, inputSize), tensor.WithBacking(vec))
200 |
201 | if err := gorgonia.Let(X2, input); err != nil {
202 | return err
203 | }
204 |
205 | machine := gorgonia.NewTapeMachine(g2)
206 | if err := machine.RunAll(); err != nil {
207 | return err
208 | }
209 |
210 | probs, ok := out.Value().Data().([]float32)
211 | if !ok {
212 | panic("failed to compute probabilities")
213 | }
214 |
215 | predicted := argmax(probs)
216 |
217 | log.Printf("Input: %-30s Predicted: %s (%v)\n", sentence, classNames[predicted], probs)
218 | }
219 |
220 | return nil
221 | }
222 |
223 | func main() {
224 | b, w, err := train()
225 | if err != nil {
226 | log.Fatal(err)
227 | }
228 |
229 | if err = predict(trainSentences, b, w); err != nil {
230 | log.Fatal(err)
231 | }
232 |
233 | log.Println("====")
234 |
235 | if err = predict([]string{
236 | "pode ligar a luz?", // comando_ligar
237 | "acenda o ar condicionado", // comando_ligar
238 | "desligue o ventilador", // comando_desligar
239 | "apague o ar", // comando_desligar
240 | "qual a temperatura agora?", // comando_consulta
241 | "está quente hoje?", // comando_consulta
242 | "ligue o ventilador da sala", // comando_ligar
243 | "desligar luz do quarto", // comando_desligar
244 | "me diga como está o clima", // comando_consulta
245 | }, b, w); err != nil {
246 | log.Fatal(err)
247 | }
248 | }
249 |
--------------------------------------------------------------------------------
/cmd/api/llm/llm.go:
--------------------------------------------------------------------------------
1 | package llm
2 |
3 | import (
4 | "context"
5 | _ "embed"
6 | "encoding/json"
7 | "fmt"
8 | "log/slog"
9 | "strings"
10 | "sync"
11 | "time"
12 |
13 | ollama_api "github.com/ollama/ollama/api"
14 | "go.opentelemetry.io/otel/attribute"
15 | "go.opentelemetry.io/otel/metric"
16 | "go.opentelemetry.io/otel/trace"
17 |
18 | "gophercon-2025/cmd/api/cache"
19 | "gophercon-2025/cmd/api/rag"
20 | "gophercon-2025/cmd/api/tokenizer"
21 | "gophercon-2025/cmd/api/tool"
22 | )
23 |
24 | type Response struct {
25 | Type string `json:"type"`
26 | Response string `json:"response"`
27 | Tool string `json:"tool"`
28 | Params map[string]string `json:"params"`
29 | Confidence float64 `json:"confidence"`
30 | }
31 |
32 | func cleanJson(s string) string {
33 | s = strings.TrimPrefix(s, "```")
34 | s = strings.TrimSuffix(s, "```")
35 | s = strings.TrimPrefix(s, "json")
36 | s = strings.TrimSuffix(s, "json")
37 | s = strings.TrimSpace(s)
38 |
39 | return s
40 | }
41 |
42 | func loadFromJson(s string) (Response, error) {
43 | s = cleanJson(s)
44 | ret := Response{}
45 | err := json.Unmarshal([]byte(s), &ret)
46 |
47 | return ret, err
48 | }
49 |
50 | type Service struct {
51 | rag *rag.Service
52 | cache *cache.Service
53 | tokenizer *tokenizer.Service
54 | tool *tool.Service
55 | ollama *ollama_api.Client
56 | logger *slog.Logger
57 | tracer trace.Tracer
58 | llmModel string
59 | minConfidenceRag float64
60 | minConfidenceTool float64
61 | minConfidenceCache float64
62 | temperature float64
63 |
64 | metricTokensInLlm metric.Int64Counter
65 | metricTokensOutLlm metric.Int64Counter
66 | metricTokensInCache metric.Int64Counter
67 | metricTokensOutCache metric.Int64Counter
68 | metricCantAnswer metric.Int64Counter
69 | }
70 |
71 | func (s *Service) Query(ctx context.Context, q string, useCache bool) (ret Response, err error) {
72 | ctx, span := s.tracer.Start(ctx, "llm.Query")
73 | defer func() {
74 | span.RecordError(err)
75 | span.End()
76 | }()
77 |
78 | if useCache {
79 | response, err := s.checkCache(ctx, q)
80 | if err != nil {
81 | return Response{}, err
82 | }
83 |
84 | if response != "" {
85 | if err = s.addCacheMetrics(ctx, span, q, response); err != nil {
86 | return Response{}, err
87 | }
88 |
89 | return Response{
90 | Type: "FINAL",
91 | Response: response,
92 | }, nil
93 | }
94 | }
95 |
96 | ret, err = s.query(ctx, q)
97 | if err != nil {
98 | return Response{}, err
99 | }
100 |
101 | switch {
102 | case strings.HasSuffix(ret.Response, "\nRAG"):
103 | s.metricCantAnswer.Add(ctx, 1)
104 | case useCache && ret.Confidence > s.minConfidenceCache:
105 | if err = s.cache.Add(ctx, q, ret.Response, ""); err != nil {
106 | return Response{}, err
107 | }
108 | }
109 |
110 | return ret, nil
111 | }
112 |
113 | func New(options ...Option) *Service {
114 | ret := &Service{}
115 |
116 | for _, option := range options {
117 | option(ret)
118 | }
119 |
120 | return ret
121 | }
122 |
123 | //go:embed system.txt
124 | var system string
125 |
126 | func (s *Service) query(octx context.Context, q string) (Response, error) {
127 | ctx, span := s.tracer.Start(octx, "llm.query")
128 | defer func() {
129 | span.End()
130 | }()
131 |
132 | s.logger.Debug("Querying RAG", "query", q)
133 |
134 | ragResSet, err := s.rag.Query(ctx, q)
135 | if err != nil {
136 | return Response{}, err
137 | }
138 |
139 | sb := strings.Builder{}
140 |
141 | prepareHeaderFunc := sync.OnceFunc(func() {
142 | sb.WriteString("Seu contexto contem dados do RAG. Considere as seguintes afirmações:\n")
143 | })
144 |
145 | span.AddEvent("rag returned", trace.WithAttributes(attribute.Int("results", len(ragResSet))))
146 |
147 | for _, ragRes := range ragResSet {
148 | switch {
149 | case ragRes.Similarity > float32(s.minConfidenceTool) && ragRes.Metadata != nil && ragRes.Metadata["type"] == "TOOL":
150 | ret, err := s.queryTool(ctx, q, ragRes.Metadata["name"])
151 | if err != nil {
152 | return Response{}, err
153 | }
154 |
155 | sb.WriteString(" - " + ret + "\n")
156 |
157 | continue
158 |
159 | case ragRes.Similarity > float32(s.minConfidenceRag):
160 | prepareHeaderFunc()
161 | s.logger.Debug("RAG: add responses", "query", q, "content", ragRes.Content, "similarity", ragRes.Similarity)
162 | sb.WriteString(" - " + ragRes.Content + "\n")
163 | }
164 | }
165 |
166 | switch {
167 | case len(sb.String()) > 0:
168 | sb.WriteString("Agora responda: " + q)
169 | default:
170 | sb.WriteString(q)
171 | }
172 |
173 | ollamaReq := &ollama_api.GenerateRequest{
174 | Model: s.llmModel,
175 | Prompt: sb.String(),
176 | System: system,
177 | Stream: new(bool),
178 | Options: map[string]any{
179 | "temperature": s.temperature,
180 | },
181 | }
182 |
183 | var ret Response
184 |
185 | respFunc := func(resp ollama_api.GenerateResponse) error {
186 | svcResp, err := loadFromJson(resp.Response)
187 | if err != nil {
188 | return err
189 | }
190 |
191 | ret = svcResp
192 |
193 | return nil
194 | }
195 |
196 | s.logger.Debug("Generating LLM response", "query", q)
197 |
198 | if err = s.ollama.Generate(ctx, ollamaReq, respFunc); err != nil {
199 | return Response{}, err
200 | }
201 |
202 | if err := s.addLlmMetrics(ctx, span, q, ret.Response); err != nil {
203 | return Response{}, err
204 | }
205 |
206 | return ret, nil
207 | }
208 |
209 | //go:embed llm_tool_prompt.txt
210 | var llmToolPrompt string
211 |
212 | func (s *Service) queryTool(octx context.Context, q string, tool string) (ret string, err error) {
213 | ctx, span := s.tracer.Start(octx, "llm.queryTool", trace.WithAttributes(attribute.String("q", q)))
214 | defer func() {
215 | span.RecordError(err)
216 | span.End()
217 | }()
218 |
219 | sb := strings.Builder{}
220 | sb.WriteString(fmt.Sprintf("Considere que a data de hoje é: %s\n", time.Now().String()))
221 | sb.WriteString(llmToolPrompt)
222 | sb.WriteString(q)
223 |
224 | ollamaReq := &ollama_api.GenerateRequest{
225 | Model: s.llmModel,
226 | Prompt: sb.String(),
227 | Stream: new(bool),
228 | Options: map[string]any{
229 | "temperature": 0.0,
230 | },
231 | }
232 |
233 | respFunc := func(resp ollama_api.GenerateResponse) error {
234 | jsonStr := cleanJson(resp.Response)
235 |
236 | params := map[string]string{}
237 | if err = json.Unmarshal([]byte(jsonStr), ¶ms); err != nil {
238 | return err
239 | }
240 |
241 | for k, v := range params {
242 | params[strings.ToLower(k)] = v
243 | }
244 |
245 | ret, err = s.tool.Query(ctx, tool, params)
246 |
247 | return err
248 | }
249 |
250 | if err = s.ollama.Generate(ctx, ollamaReq, respFunc); err != nil {
251 | return "", err
252 | }
253 |
254 | return ret, nil
255 | }
256 |
257 | func (s *Service) checkCache(ctx context.Context, q string) (ret string, err error) {
258 | ctx, span := s.tracer.Start(ctx, "llm.checkCache", trace.WithAttributes(attribute.String("q", q)))
259 | defer func() {
260 | span.RecordError(err)
261 | span.End()
262 | }()
263 |
264 | res, err := s.cache.Query(ctx, q)
265 | if err != nil {
266 | return "", err
267 | }
268 |
269 | var maxSim float32
270 |
271 | for i, ares := range res {
272 | if ares.Similarity > maxSim {
273 | maxSim = ares.Similarity
274 | }
275 |
276 | if ares.Similarity > float32(s.minConfidenceCache) {
277 | span.AddEvent("using cache", trace.WithAttributes(attribute.Int("i", i)))
278 |
279 | return ares.Metadata["RESPONSE"], nil
280 | }
281 | }
282 |
283 | span.SetAttributes(attribute.Float64("max-similarity", float64(maxSim)))
284 |
285 | span.AddEvent("no cache entries found")
286 |
287 | return "", nil
288 | }
289 |
290 | func (s *Service) addCacheMetrics(ctx context.Context, span trace.Span, in string, out string) error {
291 | tokensIn, err := s.tokenizer.Count(in)
292 | if err != nil {
293 | return err
294 | }
295 |
296 | s.metricTokensInCache.Add(ctx, int64(tokensIn))
297 | span.SetAttributes(attribute.Int64("tokens-in-cache", int64(tokensIn)))
298 |
299 | tokensOut, err := s.tokenizer.Count(out)
300 | if err != nil {
301 | return err
302 | }
303 |
304 | s.metricTokensOutCache.Add(ctx, int64(tokensOut))
305 | span.SetAttributes(attribute.Int64("tokens-out-cache", int64(tokensOut)))
306 |
307 | return nil
308 | }
309 |
310 | func (s *Service) addLlmMetrics(ctx context.Context, span trace.Span, in string, out string) error {
311 | tokensIn, err := s.tokenizer.Count(in)
312 | if err != nil {
313 | return err
314 | }
315 |
316 | s.metricTokensInLlm.Add(ctx, int64(tokensIn))
317 | span.SetAttributes(attribute.Int64("tokens-in-llm", int64(tokensIn)))
318 |
319 | tokensOut, err := s.tokenizer.Count(out)
320 | if err != nil {
321 | return err
322 | }
323 |
324 | s.metricTokensOutLlm.Add(ctx, int64(tokensOut))
325 | span.SetAttributes(attribute.Int64("tokens-out-llm", int64(tokensOut)))
326 |
327 | return nil
328 | }
329 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/go.sum:
--------------------------------------------------------------------------------
1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
2 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
3 | dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
4 | gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
5 | git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
6 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
7 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
8 | github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY=
9 | github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk=
10 | github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
11 | github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM=
12 | github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
13 | github.com/apache/arrow/go/arrow v0.0.0-20201229220542-30ce2eb5d4dc/go.mod h1:c9sxoIT3YgLxH4UhLOCKaBlEojuMhVYpk4Ntv3opUTQ=
14 | github.com/apache/arrow/go/arrow v0.0.0-20210105145422-88aaea5262db/go.mod h1:c9sxoIT3YgLxH4UhLOCKaBlEojuMhVYpk4Ntv3opUTQ=
15 | github.com/apache/arrow/go/arrow v0.0.0-20211112161151-bc219186db40 h1:q4dksr6ICHXqG5hm0ZW5IHyeEJXoIJSOZeBLmWPNeIQ=
16 | github.com/apache/arrow/go/arrow v0.0.0-20211112161151-bc219186db40/go.mod h1:Q7yQnSMnLvcXlZ8RV+jwz/6y1rQTqbX6C82SndT52Zs=
17 | github.com/awalterschulze/gographviz v0.0.0-20190221210632-1e9ccb565bca/go.mod h1:GEV5wmg4YquNw7v1kkyoX9etIk8yVmXj+AkDHuuETHs=
18 | github.com/awalterschulze/gographviz v2.0.3+incompatible h1:9sVEXJBJLwGX7EQVhLm2elIKCm7P2YHFC8v6096G09E=
19 | github.com/awalterschulze/gographviz v2.0.3+incompatible/go.mod h1:GEV5wmg4YquNw7v1kkyoX9etIk8yVmXj+AkDHuuETHs=
20 | github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
21 | github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
22 | github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
23 | github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
24 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
25 | github.com/chewxy/hm v1.0.0 h1:zy/TSv3LV2nD3dwUEQL2VhXeoXbb9QkpmdRAVUFiA6k=
26 | github.com/chewxy/hm v1.0.0/go.mod h1:qg9YI4q6Fkj/whwHR1D+bOGeF7SniIP40VweVepLjg0=
27 | github.com/chewxy/math32 v1.0.0/go.mod h1:Miac6hA1ohdDUTagnvJy/q+aNnEk16qWUdb8ZVhvCN0=
28 | github.com/chewxy/math32 v1.0.6/go.mod h1:dOB2rcuFrCn6UHrze36WSLVPKtzPMRAQvBvUwkSsLqs=
29 | github.com/chewxy/math32 v1.0.7-0.20210223031236-a3549c8cb6a9/go.mod h1:dOB2rcuFrCn6UHrze36WSLVPKtzPMRAQvBvUwkSsLqs=
30 | github.com/chewxy/math32 v1.0.8/go.mod h1:dOB2rcuFrCn6UHrze36WSLVPKtzPMRAQvBvUwkSsLqs=
31 | github.com/chewxy/math32 v1.10.1/go.mod h1:dOB2rcuFrCn6UHrze36WSLVPKtzPMRAQvBvUwkSsLqs=
32 | github.com/chewxy/math32 v1.11.0 h1:8sek2JWqeaKkVnHa7bPVqCEOUPbARo4SGxs6toKyAOo=
33 | github.com/chewxy/math32 v1.11.0/go.mod h1:dOB2rcuFrCn6UHrze36WSLVPKtzPMRAQvBvUwkSsLqs=
34 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
35 | github.com/cloudflare/cfssl v0.0.0-20190808011637-b1ec8c586c2a/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA=
36 | github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
37 | github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
38 | github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
39 | github.com/cznic/cc v0.0.0-20181122101902-d673e9b70d4d/go.mod h1:m3fD/V+XTB35Kh9zw6dzjMY+We0Q7PMf6LLIC4vuG9k=
40 | github.com/cznic/golex v0.0.0-20181122101858-9c343928389c/go.mod h1:+bmmJDNmKlhWNG+gwWCkaBoTy39Fs+bzRxVBzoTQbIc=
41 | github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM=
42 | github.com/cznic/strutil v0.0.0-20181122101858-275e90344537/go.mod h1:AHHPPPXTw0h6pVabbcbyGRK1DckRn7r/STdZEeIDzZc=
43 | github.com/cznic/xc v0.0.0-20181122101856-45b06973881e/go.mod h1:3oFoiOvCDBYH+swwf5+k/woVmWy7h1Fcyu8Qig/jjX0=
44 | github.com/danielgtaylor/huma/v2 v2.32.0 h1:ytU9ExG/axC434+soXxwNzv0uaxOb3cyCgjj8y3PmBE=
45 | github.com/danielgtaylor/huma/v2 v2.32.0/go.mod h1:9BxJwkeoPPDEJ2Bg4yPwL1mM1rYpAwCAWFKoo723spk=
46 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
47 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
48 | github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
49 | github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
50 | github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
51 | github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
52 | github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
53 | github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
54 | github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
55 | github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
56 | github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
57 | github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
58 | github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
59 | github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
60 | github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
61 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
62 | github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
63 | github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
64 | github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
65 | github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
66 | github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
67 | github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks=
68 | github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY=
69 | github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY=
70 | github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY=
71 | github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
72 | github.com/go-gota/gota v0.12.0/go.mod h1:UT+NsWpZC/FhaOyWb9Hui0jXg0Iq8e/YugZHTbyW/34=
73 | github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U=
74 | github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk=
75 | github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
76 | github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
77 | github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
78 | github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
79 | github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
80 | github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M=
81 | github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M=
82 | github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
83 | github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
84 | github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
85 | github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
86 | github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
87 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
88 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
89 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
90 | github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0=
91 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
92 | github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
93 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
94 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
95 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
96 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
97 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
98 | github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
99 | github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
100 | github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
101 | github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
102 | github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
103 | github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
104 | github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
105 | github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
106 | github.com/gonum/blas v0.0.0-20181208220705-f22b278b28ac/go.mod h1:P32wAyui1PQ58Oce/KYkOqQv8cVw1zAapXOl+dRFGbc=
107 | github.com/google/flatbuffers v1.10.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
108 | github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
109 | github.com/google/flatbuffers v1.12.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
110 | github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
111 | github.com/google/flatbuffers v2.0.6+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
112 | github.com/google/flatbuffers v24.3.25+incompatible h1:CX395cjN9Kke9mmalRoL3d81AtFUxJM+yDthflgJGkI=
113 | github.com/google/flatbuffers v24.3.25+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
114 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
115 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
116 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
117 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
118 | github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
119 | github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
120 | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
121 | github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
122 | github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
123 | github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
124 | github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
125 | github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
126 | github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
127 | github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
128 | github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
129 | github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
130 | github.com/gorgonia/bindgen v0.0.0-20180812032444-09626750019e/go.mod h1:YzKk63P9jQHkwAo2rXHBv02yPxDzoQT2cBV0x5bGV/8=
131 | github.com/gorgonia/bindgen v0.0.0-20210223094355-432cd89e7765/go.mod h1:BLHSe436vhQKRfm6wxJgebeK4fDY+ER/8jV3vVH9yYU=
132 | github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
133 | github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 h1:e9Rjr40Z98/clHv5Yg79Is0NtosR5LXRvdr7o/6NwbA=
134 | github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1/go.mod h1:tIxuGz/9mpox++sgp9fJjHO0+q1X9/UOWd798aAm22M=
135 | github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
136 | github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
137 | github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
138 | github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
139 | github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
140 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
141 | github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
142 | github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
143 | github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
144 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
145 | github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
146 | github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
147 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
148 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
149 | github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
150 | github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
151 | github.com/leesper/go_rng v0.0.0-20171009123644-5344a9259b21/go.mod h1:N0SVk0uhy+E1PZ3C9ctsPRlvOPAFPkCNlcPBDkt0N3U=
152 | github.com/leesper/go_rng v0.0.0-20190531154944-a612b043e353 h1:X/79QL0b4YJVO5+OsPH9rF2u428CIrGL/jLmPsoOQQ4=
153 | github.com/leesper/go_rng v0.0.0-20190531154944-a612b043e353/go.mod h1:N0SVk0uhy+E1PZ3C9ctsPRlvOPAFPkCNlcPBDkt0N3U=
154 | github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
155 | github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
156 | github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
157 | github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
158 | github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
159 | github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
160 | github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
161 | github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
162 | github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY=
163 | github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg=
164 | github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ=
165 | github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw=
166 | github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4=
167 | github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
168 | github.com/ollama/ollama v0.6.6 h1:rnCQTSTiRD3Dsvd35dh2j2YB9DlQMFQR/y3XOhWZOmI=
169 | github.com/ollama/ollama v0.6.6/go.mod h1:pGgtoNyc9DdM6oZI6yMfI6jTk2Eh4c36c2GpfQCH7PY=
170 | github.com/philippgille/chromem-go v0.7.0 h1:4jfvfyKymjKNfGxBUhHUcj1kp7B17NL/I1P+vGh1RvY=
171 | github.com/philippgille/chromem-go v0.7.0/go.mod h1:hTd+wGEm/fFPQl7ilfCwQXkgEUxceYh86iIdoKMolPo=
172 | github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY=
173 | github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
174 | github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
175 | github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
176 | github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU=
177 | github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
178 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
179 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
180 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
181 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
182 | github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
183 | github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
184 | github.com/pressly/goose/v3 v3.24.2 h1:c/ie0Gm8rnIVKvnDQ/scHErv46jrDv9b4I0WRcFJzYU=
185 | github.com/pressly/goose/v3 v3.24.2/go.mod h1:kjefwFB0eR4w30Td2Gj2Mznyw94vSP+2jJYkOVNbD1k=
186 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
187 | github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
188 | github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
189 | github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
190 | github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
191 | github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
192 | github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
193 | github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
194 | github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
195 | github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
196 | github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
197 | github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
198 | github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
199 | github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk=
200 | github.com/schollz/progressbar/v2 v2.15.0 h1:dVzHQ8fHRmtPjD3K10jT3Qgn/+H+92jhPrhmxIJfDz8=
201 | github.com/schollz/progressbar/v2 v2.15.0/go.mod h1:UdPq3prGkfQ7MOzZKlDRpYKcFqEMczbD7YmbPgpzKMI=
202 | github.com/sethvargo/go-retry v0.3.0 h1:EEt31A35QhrcRZtrYFDTBg91cqZVnFL2navjDrah2SE=
203 | github.com/sethvargo/go-retry v0.3.0/go.mod h1:mNX17F0C/HguQMyMyJxcnU471gOZGxCLyYaFyAZraas=
204 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
205 | github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
206 | github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
207 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
208 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
209 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
210 | github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
211 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
212 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
213 | github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
214 | github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
215 | github.com/sugarme/regexpset v0.0.0-20200920021344-4d4ec8eaf93c h1:pwb4kNSHb4K89ymCaN+5lPH/MwnfSVg4rzGDh4d+iy4=
216 | github.com/sugarme/regexpset v0.0.0-20200920021344-4d4ec8eaf93c/go.mod h1:2gwkXLWbDGUQWeL3RtpCmcY4mzCtU13kb9UsAg9xMaw=
217 | github.com/sugarme/tokenizer v0.2.2 h1:7X9324fqWSWU2U0oQeN5wNH7CJuYdehOS9Io4f/Xkow=
218 | github.com/sugarme/tokenizer v0.2.2/go.mod h1:2MKkQ/K0zFUFO4inPZ8rQaz+sJVz62LhbQG83rcuITA=
219 | github.com/urfave/cli/v3 v3.1.1 h1:bNnl8pFI5dxPOjeONvFCDFoECLQsceDG4ejahs4Jtxk=
220 | github.com/urfave/cli/v3 v3.1.1/go.mod h1:FJSKtM/9AiiTOJL4fJ6TbMUkxBXn7GO9guZqoZtpYpo=
221 | github.com/xtgo/set v1.0.0 h1:6BCNBRv3ORNDQ7fyoJXRv+tstJz3m1JVFQErfeZz2pY=
222 | github.com/xtgo/set v1.0.0/go.mod h1:d3NHzGzSa0NmB2NhFyECA+QdRp29oEn2xbT+TpeFoM8=
223 | github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
224 | github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
225 | github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
226 | github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
227 | go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
228 | go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
229 | go.opentelemetry.io/contrib/bridges/otelslog v0.10.0 h1:lRKWBp9nWoBe1HKXzc3ovkro7YZSb72X2+3zYNxfXiU=
230 | go.opentelemetry.io/contrib/bridges/otelslog v0.10.0/go.mod h1:D+iyUv/Wxbw5LUDO5oh7x744ypftIryiWjoj42I6EKs=
231 | go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ=
232 | go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y=
233 | go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0 h1:HMUytBT3uGhPKYY/u/G5MR9itrlSO2SMOsSD3Tk3k7A=
234 | go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0/go.mod h1:hdDXsiNLmdW/9BF2jQpnHHlhFajpWCEYfM6e5m2OAZg=
235 | go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0 h1:QcFwRrZLc82r8wODjvyCbP7Ifp3UANaBSmhDSFjnqSc=
236 | go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0/go.mod h1:CXIWhUomyWBG/oY2/r/kLp6K/cmx9e/7DLpBuuGdLCA=
237 | go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 h1:1fTNlAIJZGWLP5FVu0fikVry1IsiUnXjf7QFvoNN3Xw=
238 | go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0/go.mod h1:zjPK58DtkqQFn+YUMbx0M2XV3QgKU0gS9LeGohREyK4=
239 | go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 h1:m639+BofXTvcY1q8CGs4ItwQarYtJPOWmVobfM1HpVI=
240 | go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0/go.mod h1:LjReUci/F4BUyv+y4dwnq3h/26iNOeC3wAIqgvTIZVo=
241 | go.opentelemetry.io/otel/log v0.11.0 h1:c24Hrlk5WJ8JWcwbQxdBqxZdOK7PcP/LFtOtwpDTe3Y=
242 | go.opentelemetry.io/otel/log v0.11.0/go.mod h1:U/sxQ83FPmT29trrifhQg+Zj2lo1/IPN1PF6RTFqdwc=
243 | go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M=
244 | go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE=
245 | go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY=
246 | go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg=
247 | go.opentelemetry.io/otel/sdk/log v0.11.0 h1:7bAOpjpGglWhdEzP8z0VXc4jObOiDEwr3IYbhBnjk2c=
248 | go.opentelemetry.io/otel/sdk/log v0.11.0/go.mod h1:dndLTxZbwBstZoqsJB3kGsRPkpAgaJrWfQg3lhlHFFY=
249 | go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o=
250 | go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w=
251 | go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs=
252 | go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
253 | go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
254 | go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
255 | go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
256 | go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
257 | go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
258 | go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
259 | go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
260 | go4.org/unsafe/assume-no-moving-gc v0.0.0-20201222180813-1025295fd063/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
261 | go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
262 | go4.org/unsafe/assume-no-moving-gc v0.0.0-20231121144256-b99613f794b6 h1:lGdhQUN/cnWdSH3291CUuxSEqc+AsGTiDxPP3r2J0l4=
263 | go4.org/unsafe/assume-no-moving-gc v0.0.0-20231121144256-b99613f794b6/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
264 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
265 | golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
266 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
267 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
268 | golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
269 | golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
270 | golang.org/x/exp v0.0.0-20181106170214-d68db9428509/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
271 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
272 | golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
273 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
274 | golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
275 | golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE=
276 | golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw=
277 | golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM=
278 | golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
279 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
280 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
281 | golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
282 | golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
283 | golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
284 | golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
285 | golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
286 | golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
287 | golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
288 | golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
289 | golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
290 | golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
291 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
292 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
293 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
294 | golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
295 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
296 | golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
297 | golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
298 | golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
299 | golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
300 | golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
301 | golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
302 | golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
303 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
304 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
305 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
306 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
307 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
308 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
309 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
310 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
311 | golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
312 | golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
313 | golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
314 | golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
315 | golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
316 | golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
317 | golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
318 | golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
319 | golang.org/x/net v0.0.0-20220401154927-543a649e0bdd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
320 | golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
321 | golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
322 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
323 | golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
324 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
325 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
326 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
327 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
328 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
329 | golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
330 | golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
331 | golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
332 | golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
333 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
334 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
335 | golang.org/x/sys v0.0.0-20190226215855-775f8194d0f9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
336 | golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
337 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
338 | golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
339 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
340 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
341 | golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
342 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
343 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
344 | golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
345 | golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
346 | golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
347 | golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
348 | golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
349 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
350 | golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
351 | golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
352 | golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
353 | golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
354 | golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
355 | golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
356 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
357 | golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
358 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
359 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
360 | golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
361 | golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
362 | golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
363 | golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
364 | golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
365 | golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
366 | golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
367 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
368 | golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
369 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
370 | golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
371 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
372 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
373 | golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
374 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
375 | golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
376 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
377 | golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
378 | golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
379 | golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
380 | golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
381 | golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
382 | golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
383 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
384 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
385 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
386 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
387 | golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 h1:LLhsEBxRTBLuKlQxFBYUOU8xyFgXv6cOTp2HASDlsDk=
388 | golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
389 | gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
390 | gonum.org/v1/gonum v0.0.0-20190226202314-149afe6ec0b6/go.mod h1:jevfED4GnIEnJrWW55YmY9DMhajHcnkqVnEXmEtMyNI=
391 | gonum.org/v1/gonum v0.0.0-20190902003836-43865b531bee/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU=
392 | gonum.org/v1/gonum v0.8.1-0.20200930085651-eea0b5cb5cc9/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0=
393 | gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0=
394 | gonum.org/v1/gonum v0.9.1/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0=
395 | gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0=
396 | gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA=
397 | gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ=
398 | gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo=
399 | gonum.org/v1/netlib v0.0.0-20190221094214-0632e2ebbd2d/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
400 | gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
401 | gonum.org/v1/netlib v0.0.0-20201012070519-2390d26c3658/go.mod h1:zQa7n16lh3Z6FbSTYgjG+KNhz1bA/b9t3plFEaGMp+A=
402 | gonum.org/v1/netlib v0.0.0-20220323200511-14de99971b2d/go.mod h1:ObwMamC//3VQXZ2+uTOuOfnJNnZPdwBUibkUGgltkQA=
403 | gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc=
404 | gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY=
405 | gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo=
406 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
407 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
408 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
409 | google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
410 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
411 | google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
412 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
413 | google.golang.org/genproto v0.0.0-20200911024640-645f7a48b24f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
414 | google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U=
415 | google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e h1:UdXH7Kzbj+Vzastr5nVfccbmFsmYNygVLSPk1pEfDoY=
416 | google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e/go.mod h1:085qFyf2+XaZlRdCgKNCIZ3afY2p4HHZdoIRpId8F4A=
417 | google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e h1:ztQaXfzEXTmCBvbtWYRhJxW+0iJcz2qXfd38/e9l7bA=
418 | google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
419 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
420 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
421 | google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
422 | google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
423 | google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
424 | google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
425 | google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
426 | google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
427 | google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
428 | google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=
429 | google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
430 | google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200910201057-6591123024b3/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
431 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
432 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
433 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
434 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
435 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
436 | google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
437 | google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
438 | google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
439 | google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
440 | google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
441 | google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
442 | google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
443 | google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
444 | google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
445 | google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
446 | google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
447 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
448 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
449 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
450 | gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
451 | gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
452 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
453 | gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
454 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
455 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
456 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
457 | gorgonia.org/cu v0.9.0-beta/go.mod h1:RPEPIfaxxqUmeRe7T1T8a0NER+KxBI2McoLEXhP1Vd8=
458 | gorgonia.org/cu v0.9.3/go.mod h1:LgyAYDkN7HWhh8orGnCY2R8pP9PYbO44ivEbLMatkVU=
459 | gorgonia.org/cu v0.9.4 h1:XTnzfusx/0caMCfG3oJse+LW8SBmReA/613Mo7ZSVQI=
460 | gorgonia.org/cu v0.9.4/go.mod h1:nR6RAm64n9htu6Orv1NVbsMJXHjnsC3SHPfgcxI08e4=
461 | gorgonia.org/dawson v1.1.0/go.mod h1:Px1mcziba8YUBIDsbzGwbKJ11uIblv/zkln4jNrZ9Ws=
462 | gorgonia.org/dawson v1.2.0 h1:hJ/aofhfkReSnJdSMDzypRZ/oWDL1TmeYOauBnXKdFw=
463 | gorgonia.org/dawson v1.2.0/go.mod h1:Px1mcziba8YUBIDsbzGwbKJ11uIblv/zkln4jNrZ9Ws=
464 | gorgonia.org/gorgonia v0.9.2/go.mod h1:ZtOb9f/wM2OMta1ISGspQ4roGDgz9d9dKOaPNvGR+ec=
465 | gorgonia.org/gorgonia v0.9.17/go.mod h1:g66b5Z6ATUdhVqYl2ZAAwblv5hnGW08vNinGLcnrceI=
466 | gorgonia.org/gorgonia v0.9.18 h1:LlEhqMjPwyKlLdy3iuWHI2k1znxormNedKayQaLgbm0=
467 | gorgonia.org/gorgonia v0.9.18/go.mod h1:kYe25GPmZ+1ycLqfKDQx+50UIhklCU7lSDXiotON/f4=
468 | gorgonia.org/tensor v0.9.0-beta/go.mod h1:05Y4laKuVlj4qFoZIZW1q/9n1jZkgDBOLmKXZdBLG1w=
469 | gorgonia.org/tensor v0.9.17/go.mod h1:75SMdLLhZ+2oB0/EE8lFEIt1Caoykdd4bz1mAe59deg=
470 | gorgonia.org/tensor v0.9.20/go.mod h1:75SMdLLhZ+2oB0/EE8lFEIt1Caoykdd4bz1mAe59deg=
471 | gorgonia.org/tensor v0.9.23/go.mod h1:ZaFaLqBTKTzTbTzfnfbW8gDxFP2mXScMzjffUkSsK5Y=
472 | gorgonia.org/tensor v0.9.24 h1:8ahrfwO4iby+1ILObIqfjJa+wyA2RoCfJSS3LVERSRE=
473 | gorgonia.org/tensor v0.9.24/go.mod h1:1dsOegMm2n1obs69YnVJdp2oPSKx9Q9Tco5i7GEaXRg=
474 | gorgonia.org/vecf32 v0.7.0/go.mod h1:iHG+kvTMqGYA0SgahfO2k62WRnxmHsqAREGbayRDzy8=
475 | gorgonia.org/vecf32 v0.9.0 h1:PClazic1r+JVJ1dEzRXgeiVl4g1/Hf/w+wUSqnco1Xg=
476 | gorgonia.org/vecf32 v0.9.0/go.mod h1:NCc+5D2oxddRL11hd+pCB1PEyXWOyiQxfZ/1wwhOXCA=
477 | gorgonia.org/vecf64 v0.7.0/go.mod h1:1y4pmcSd+wh3phG+InwWQjYrqwyrtN9h27WLFVQfV1Q=
478 | gorgonia.org/vecf64 v0.9.0 h1:bgZDP5x0OzBF64PjMGC3EvTdOoMEcmfAh1VCUnZFm1A=
479 | gorgonia.org/vecf64 v0.9.0/go.mod h1:hp7IOWCnRiVQKON73kkC/AUMtEXyf9kGlVrtPQ9ccVA=
480 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
481 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
482 | honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
483 | modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
484 | modernc.org/cc v1.0.1/go.mod h1:uj1/YV+GYVdtSfGOgOtY62Jz8YIiEC0EzZNq481HIQs=
485 | modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8=
486 | modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
487 | modernc.org/golex v1.0.1/go.mod h1:QCA53QtsT1NdGkaZZkF5ezFwk4IXh4BGNafAARTC254=
488 | modernc.org/internal v1.0.0/go.mod h1:VUD/+JAkhCpvkUitlEOnhpVxCgsBI90oTzSCRcqQVSM=
489 | modernc.org/ir v1.0.0/go.mod h1:wxK1nK3PS04CASoUY+HJr+FQywv4+D38y2sRrd71y7s=
490 | modernc.org/lex v1.0.0/go.mod h1:G6rxMTy3cH2iA0iXL/HRRv4Znu8MK4higxph/lE7ypk=
491 | modernc.org/lexer v1.0.0/go.mod h1:F/Dld0YKYdZCLQ7bD0USbWL4YKCyTDRDHiDTOs0q0vk=
492 | modernc.org/libc v1.61.13 h1:3LRd6ZO1ezsFiX1y+bHd1ipyEHIJKvuprv0sLTBwLW8=
493 | modernc.org/libc v1.61.13/go.mod h1:8F/uJWL/3nNil0Lgt1Dpz+GgkApWh04N3el3hxJcA6E=
494 | modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
495 | modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
496 | modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
497 | modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
498 | modernc.org/memory v1.9.1 h1:V/Z1solwAVmMW1yttq3nDdZPJqV1rM05Ccq6KMSZ34g=
499 | modernc.org/memory v1.9.1/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
500 | modernc.org/sqlite v1.36.2 h1:vjcSazuoFve9Wm0IVNHgmJECoOXLZM1KfMXbcX2axHA=
501 | modernc.org/sqlite v1.36.2/go.mod h1:ADySlx7K4FdY5MaJcEv86hTJ0PjedAloTUuif0YS3ws=
502 | modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
503 | modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
504 | modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I=
505 | rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
506 |
--------------------------------------------------------------------------------