2024/03 8

Hello LangChain 기초편

LangChain 의 기초는 Promp -> LLM -> Output 으로 구성되어 있다. LangChain 의 프로그래밍 방법도 이러한 구조와 동일하다. from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import ChatPromptTemplate from langchain_openai import ChatOpenAI prompt = ChatPromptTemplate.from_template("tell me a short joke about {topic}") model = ChatOpenAI(model="gpt-4") output_parser = StrOutputParser() chain = pro..

R&D/AI 2024.03.29

LangChain 의 Agent 에 대해서 (개요)

LangChain 에서 Agent 에 대해서 정리합니다. 기본적인 LLM의 동작 방식이 사용자가 입력한 Prompt에 대해서 적절한 Output을 출력한다라고 하면, Agent 는 복잡하고 정교한 사고 작업을 실행할 수 있도록 설계되어 있습니다. # Concept Agent는 Task를 수행하기 위해서 주어진 도구(Tools)와 현재 상황을 고려하여 사고(Thought)하고 필요한 다음 행동을 설계하는 역할을 합니다. 이는 Agent가 주어진 작업에 대해 상세한 계획을 세우고 실행하는 것을 의미합니다. # Agent Overview Agent 는 다음과 같은 핵심 기능을 가지고 있습니다. Planning subgoal and decomposition: Agent는 자신에게 주어진 Task를 더 작은 su..

R&D/AI 2024.03.27

git push origin HEAD

그냥 git push를 하면 에러가 날 때가 있다. 어느 브랜치에 푸시해야 할지 모르는 경우일 때 발생한다. 이 때 설정 값은 git-config 문서에 따르면 push.default로 설정할 수 있는 옵션에는 여러 가지가 있습니다. nothing : 명시적으로 어디로 보낼 지를 다 작성해야 합니다. (그냥 쓰면 푸쉬하지 않습니다.) current : 원격 저장소에 같은 이름의 branch에 push합니다. upstream : 현재 작업중인 branch를 지정해둔 원격 저장소의 branch로 push 합니다. simple : 현재 작업중인 branch와 원격 저장소의 branch명이 같을 때만 push합니다. (기본 설정) matching : 로컬과 원격 저장소의 브랜치명이 같은 모든 branch를 pu..

Passion/Programming 2024.03.21

Github Action를 개발하여 배포하기

Github actions를 직접 개발하여 공유할 수 있다. 참고: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages Publishing Node.js packages - GitHub Docs You can publish Node.js packages to a registry as part of your continuous integration (CI) workflow. docs.github.com https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action?learn=create_actions&learnProduct=acti..

R&D/클라우드 2024.03.21