code.oscarkilo.com/klex-git/api/funcs.go

..
api.go
datasets.go
f.go
funcs.go
messages.go
pipelines.go
worker.go
package api

type NewFuncRequest struct {
  Name string `json:"name"`  // no need to be unique
  JsCode string `json:"js_code,omitempty"`  // LLM2 must be nil
  LLM2 *LLMFunc `json:"llm2,omitempty"`  // JSCode must be ""
}

type NewFuncResponse struct {
  Name string `json:"name"`
  DateCreated string `json:"date_created"`  // RFC8601 with millis
}

type DeleteFuncRequest struct {
  Name string `json:"name"`
}

type DeleteFuncResponse struct {
}

type FuncVersion struct {
  // Hash is the globally unique ID of this immutable object.
  Hash string `json:"hash"`

  // Date is the time of creation, according to the server's clock.
  Date string `json:"date"`

  // JS is JavaScript code that implements this function.
  JS string `json:"js,omitempty"`

  // LLM is the old "provider:model" string. Deprecated.
  LLM string `json:"llm,omitempty"`

  // LLM2 confugures where an how the LLM is run.
  LLM2 *LLMFunc `json:"llm2,omitempty"`
}

type LLMFunc struct {
  // Provider is "openai", "anthropic", "fireworks", etc.
  Provider string `json:"provider"`

  // Model is the provider-assigned name of the LLM.
  Model string `json:"model"`

  CanSeeImages bool `json:"can_see_images"`
  CanHaveSystemPromps bool `json:"can_have_system_prompts"`
  CanUseTools bool `json:"can_use_tools"`
}

type Func struct {
  Name string `json:"name"`
  Versions []FuncVersion `json:"versions"`
}

type ListFuncsResponse struct {
  Funcs []Func `json:"funcs"`
}