Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2025 Build with AI for Everyone - Hands on : Go...

2025 Build with AI for Everyone - Hands on : Go 언어로 AI & Agents 서비스 개발하기: Langchain, Eino 활용까지 @박제창

2025년 5월 17일
Build with AI 행사의 핸즈온 자료

2025 Build with AI for Everyone - Hands on
Go 언어로 AI & Agents 서비스 개발하기: Langchain, Eino 활용까지 @박제창 @jaichangpark

- https://event-us.kr/golangkorea/event/102929
- https://gdg.community.dev/events/details/google-gdg-golang-korea-presents-build-with-ai-for-everyone/cohost-gdg-golang-korea

Avatar for JaiChangPark

JaiChangPark

May 17, 2025
Tweet

More Decks by JaiChangPark

Other Decks in Programming

Transcript

  1. Go 언어로 AI & Agents 서비스 개발하기: Langchain, Langgraph 그리고

    Eino 활용까지 Hands-on @jaichangpark Golang Korea 1
  2. 16 var i, j int = 1, 2 a, b

    := swap("hello", "world")
  3. 17 foo := make([]int, 0, 5) bar := []string{"딥러닝과 머신러닝의

    차이", "동해물과 백두산이 마르고 닳도록"}
  4. 18 var id map[int]string fmt.Println(id == nil) // 출력: true

    value := id[1] // 읽기는 가능 (제로 값 "" 반환) fmt.Println(value) // 출력: // id[1] = "value" // 런타임 패닉 발생!
  5. 23

  6. 25

  7. 26

  8. 27

  9. Step 1 30 Step 2 Step 3 Step 4 Gemini와

    소통하기 LangChain 사용하기 Eino 사용하기
  10. 33

  11. 37

  12. 38

  13. 39

  14. 41

  15. 42

  16. 45 env파일 만들기 if err := godotenv.Load(); err != nil

    { log.Fatal("No .env file found") } // Loads from environment // Loads the API key from environment apiKey := os.Getenv("GOOGLE_API_KEY") if apiKey == "" { log.Fatal("Set your GOOGLE_API_KEY environment variable in the .env file") }
  17. 49

  18. 50

  19. 51

  20. 52

  21. 53 g := compose.NewGraph[map[string]any, *schema.Message]() pt := prompt.FromMessages( schema.FString, schema.UserMessage("what's

    the weather in {location}?"), ) _ = g.AddChatTemplateNode(nodeOfPrompt, pt) _ = g.AddChatModelNode(nodeOfModel, &mockChatModel{}, compose.WithNodeName("ChatModel")) _ = g.AddEdge(compose.START, nodeOfPrompt) _ = g.AddEdge(nodeOfPrompt, nodeOfModel) _ = g.AddEdge(nodeOfModel, compose.END) r, err := g.Compile(ctx, compose.WithMaxRunSteps(10)) if err != nil { panic(err) }