developing-genkit-go
하는 일
이 스킬은 Genkit SDK를 사용해 Go로 AI 기능을 만드는 개발자를 돕습니다. 백엔드를 Go로 운영하면서 모델 호출이나 에이전트를 추가하려는 팀을 위한 스킬입니다.
사용하는 경우
- ✓Genkit을 써서 Go로 AI 기능, 에이전트 또는 플로우를 만들고 싶을 때.
- ✓Go 서비스에서 텍스트 생성, 스트리밍 또는 도구 호출이 필요할 때.
- ✓Go 서버를 위해 Genkit 플러그인과 HTTP 핸들러를 설정하고 싶을 때.
스킬 링크
https://github.com/google/skills/blob/main/skills/cloud/developing-genkit-go/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“사용자가 보낸 어떤 주제든 농담을 들려주는 Genkit 플로우가 있는 Go 서버를 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
Genkit의 init, 플로우, 생성 함수를 사용하는 Go 코드를 작성하며, 샘플 서버도 포함합니다. 필요할 때 각 기능의 참조 가이드를 불러옵니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Genkit Go
Genkit Go is an AI SDK for Go that provides generation, structured output, streaming, tool calling, prompts, and flows with a unified interface across model providers.
Hello World
package main
import (
"context"
"fmt"
"log"
"net/http"
"github.com/firebase/genkit/go/ai"
"github.com/firebase/genkit/go/genkit"
"github.com/firebase/genkit/go/plugins/googlegenai"
"github.com/firebase/genkit/go/plugins/server"
)
func main() {
ctx := context.Background()
g := genkit.Init(ctx, genkit.WithPlugins(&googlegenai.GoogleAI{}))
genkit.DefineFlow(g, "jokeFlow", func(ctx context.Context, topic string) (string, error) {
return genkit.GenerateText(ctx, g,
ai.WithModelName("googleai/gemini-flash-latest"),
ai.WithPrompt("Tell me a joke about %s", topic),
)
})
mux := http.NewServeMux()
for _, f := range genkit.ListFlows(g) {
mux.HandleFunc("POST /"+f.Name(), genkit.Handler(f))
}
log.Fatal(server.Start(ctx, "127.0.0.1:8080", mux))
}
Core Features
Load the appropriate reference based on what you need:
| Feature | Reference | When to load |
|---|---|---|
| Initialization | references/getting-started.md | Setting up genkit.Init, plugins, the *Genkit instance pattern |
| Generation | references/generation.md | Generate, GenerateText, GenerateData, streaming, output formats |
| Prompts | references/prompts.md | DefinePrompt, DefineDataPrompt, .prompt files, schemas |
| Tools | references/tools.md | DefineTool, DefineResumableTool interrupts (Interrupted claim, Restart/Respond, WithResume), ai/tool helpers (tool.Interrupt, tool.Fail, tool.AttachParts) |
| Middleware | references/middleware.md | ai.Middleware, ai.WithUse, Hooks (Generate/Model/Tool), built-ins (Retry, Fallback, ToolApproval, Filesystem, Skills, SoftToolErrors, ContextCompression, Budget) |
| Observability | references/observability.md | OpenTelemetry export (otelgenai), tracing.SetInstrumentation, aix.Observer, reflection API outside dev |
| Flows & HTTP | references/flows-and-http.md | DefineFlow, DefineStreamingFlow, genkit.Handler, HTTP serving |
| Model Providers | references/providers.md | Google AI, Vertex AI, Anthropic, OpenAI-compatible, Ollama setup |
Agents (Experimental)
Genkit Go has an experimental agent API for persistent, multi-turn
conversations (sessions, snapshots, interrupts, branching, background execution).
It is gated: initialize with genkit.Init(ctx, genkit.WithExperimental()) or the
constructors panic. Server constructors come from genkit/exp (aliased
genkitx); types and options from ai/exp (aliased aix); session stores from
ai/exp/localstore.
- Agent or flow? If the task is conversational, multi-turn, or described as "an agent", "assistant", or "chatbot", build it with
genkitx.DefineAgentrather than hand-rolling aGenerate+ tools loop in a flow. Reach for a plain flow only for single-shot, stateless generation.
For details see:
- Agents: defining/serving an agent, running turns, and client- vs server-managed state (start here).
- Sessions & persistence: session stores (
localstore.NewInMemorySessionStore/NewFileSessionStore, PostgreSQL), snapshots, and thesessionstoretestconformance suite. - Human-in-the-loop / interrupts: pausing for approval/input and resuming.
- Branching: forking a conversation from a snapshot.
- Background agents: detaching long-running turns and polling.
- Working with state: typed custom session state, streamed as JSON patches.
- Artifacts: producing and reading named deliverables.
- Multi-agent orchestration: delegating to sub-agents, background delegation,
continue_task, and remote agents (DefineRemoteAgent). - Advanced custom agents:
DefineCustomAgentfor full turn control. - Deploying agents: serving agents over HTTP with
genkit.Handler.
Generative UI (A2UI)
Genkit
자주 묻는 질문
어떤 모델 제공자를 지원하나요?
모델 제공자 전반에 하나의 인터페이스를 사용하며, Google AI는 예시 플러그인 중 하나입니다.
예제가 있나요?
네. HTTP로 제공되는 hello-world 플로우가 포함되어 있습니다.
구조화된 출력도 다루나요?
네. 생성과 함께 구조화된 출력과 프롬프트도 다룹니다.
상세 정보
작성자의 원본 설명
Develop AI-powered applications using Genkit in Go. Use when the user asks to build AI features, agents, flows, or tools in Go using Genkit, or when working with Genkit Go code involving generation, prompts, streaming, tool calling, or model providers.
repo: google/skills
인기도
- GitHub 스타
- 22k
- 순위
- #10256
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
finding-google-skills
22k에이전트가 호스팅, 데이터베이스, 저장소, 로그인, AI 모델 제공처럼 설정 작업에 맞는 Google 가이드를 찾도록 돕습니다.
gcloud
22k에이전트가 Google Cloud gcloud 명령을 작성하고 확인하도록 돕습니다. 플래그를 추측하지 않도록 무엇이든 실행하기 전에 정확한 문법을 확인합니다.
google-cloud-recipe-auth
22k에이전트가 Google Cloud의 신원과 접근 권한을 안내합니다. 사람과 서비스가 어떻게 로그인하고 어떤 권한을 받는지 포함합니다.
google-cloud-recipe-onboarding
22k새 개발자가 Google Cloud에서 프로젝트 선택, 결제 연결, 첫 리소스 배포 같은 첫 단계를 밟도록 안내합니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.