Movatterモバイル変換


[0]ホーム

URL:


taskname

package
v2.29.1Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2025 License:AGPL-3.0Imports:16Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (ErrNoAPIKey        =xerrors.New("no api key provided")ErrNoNameGenerated =xerrors.New("no task name generated"))

Functions

This section is empty.

Types

typeTaskNameadded inv2.29.0

type TaskName struct {Namestring `json:"task_name"`DisplayNamestring `json:"display_name"`}

funcGenerate

func Generate(ctxcontext.Context, loggerslog.Logger, promptstring)TaskName

Generate creates a task name and display name from a user prompt.It attempts multiple strategies in order of preference:

  1. Use Claude (Anthropic) to generate semantic names from the prompt if an API key is available
  2. Sanitize the prompt directly into a valid task name
  3. Generate a random name as a final fallback

A suffix is always appended to task names to reduce collision risk.This function always succeeds and returns a valid TaskName.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp