도커사용권장
sudo serivce docker start
docker build -t <server:version_tag> .
docker stop <server:version_tag>
docker rm <server:version_tag>
docker run [--name<container_name>] [-p<host_port:container_port>] [-it] <server:version_tag>
- it옵션은 iteractive 모드
- 탈출은 ctrl+p + ctrl+q
docker attach <container_name>으로 재진입가능
docker-compose .
version: "3" # docker compose 파일의 버전
services: # 실행할 서비스들의 목록
service1: # 서비스의 이름
build: ./service1 # 서비스를 빌드하기 위한 Dockerfile의 위치
image: service1 # 서비스의 이미지 이름
ports: # 서비스가 사용할 포트들
- "5000:5000" # 호스트 포트:컨테이너 포트
volumes: # 서비스가 사용할 볼륨들
- ./service1:/app # 호스트 디렉토리:컨테이너 디렉토리
depends_on: # 서비스가 의존하는 다른 서비스들
- service2
service2:
image: redis # 이미 존재하는 이미지를 사용하는 경우
environment: # 서비스에 전달할 환경변수들
- REDIS_HOST=redis
docker-compose up: docker compose 파일에 정의된 모든 서비스를 빌드하고 실행합니다. -d 옵션을 주면 백그라운드에서 실행합니다.
docker-compose ps: docker compose 파일에 정의된 모든 서비스의 상태를 확인합니다.
docker-compose logs: docker compose 파일에 정의된 모든 서비스의 로그를 출력합니다. -f 옵션을 주면 실시간으로 로그를 보여줍니다.
docker-compose run: docker compose 파일에 정의된 특정 서비스를 실행하고 명령어를 수행합니다. 예를 들어, docker-compose run service1 bash는 service1 컨테이너에서 bash 셸을 실행합니다.
docker-compose start / stop / restart: docker compose 파일에 정의된 모든 서비스를 시작 / 중지 / 재시작합니다.
docker-compose rm: docker compose 파일에 정의된 모든 서비스를 삭제합니다.
쿠버네티스 - CICD
1.ID생성 2. API 두개사용 3. 쿼리문 4. 답변에 필요한 문서는? 5. 주문목록을 유지할 필요가 있다. 6. 꼭 필요한 기억만 유지하자
-
API의 출력형태
- json
- cotent와 command
-
chat -> agent
- 채팅을 관리하지말고 메시지목록과 처리기를 따로관리하자
- agent는 대화를 생성하고 명령을 실행해야한다.
-
명령을 정의하자
- 쿼리문의 경우 GPT가 충분히 SQL을 작성할 수 있지만, 이걸 직접 실행 시킬 수 있으면 보안상 문제가 발생한다. -> 아싸리 한정적인 명령만 수행 할 수 있게하자
-
NLP은 GPT-3.5가 처리해야한다.
-
"불고기버거 주세요"
-
불고기 버거가 존재하는지?
-
NLP가 필요하다.
-
CMD로 바꿔서 불고기 버거를찾는다?
주문 대화에는 두가지 방향이 있다. 주문자가 점원에게 일방적으로 요청하면 바로 점원이 알아듣는다. 점원이 권유할때가 있을까? 어떤가요? 좋아요! -> 요걸 명령어로 만들수 있어야한다.
Order의 lifecycle을 위한 State
-
Greet : 시작, manual에 인사, 고객응대에 관여
-
Order : 주문을 주고받는 상태
- cart가 채워졌을때 더 주문할게 없는지 물어봐야한다.
-
Option : 전체 주문에 대한 옵션??(포장 / 매장)
-
Pay : 주문단계
-
Done : 완료된 주문
-
유저의 대화를 입력받는다.
- 유저의 대화를 해석해 생성에 필요한 해석해 정보를 준비하는과정이 필요하다. -> ls, info
- 이전 명령어에 대한 동의를 구한다.
-
유저의 대화에 대한 어시스턴트의 답변을 생성한다.
-
어시스턴트의 동작을 명령어화한다. -> add, remove
- 되묻는 말이면 해당 명령어에 대한 유저의 동의를 구해야 명령어가 적용될것이다.
- 마찬가지로 _"어느정도"_주문이 완료되면 다음단계(결제)로 넘어갈지 물어야한다. 조건은?
직전 스텝의 명령어를 보관할 필요가 있다.
-> 유저 명령 추출과 어시스턴트명령 추출은 프롬프트가 달라야한다.(정의된 명령어셋이다르다.) -> 이를 해석하기 위한 switch 문도 별개이다.
#1
Convert context to command.
You must follow example. as short as possible.
if context is about adding items from orderlist-> add id count
if context is about removing items from orderlist-> rm id count
if context about ask about item info -> info id
if context about ask cart(order list) -> ls
other context -> -
- If second arg is exist, the arg declare follow list [${menu}]
- If the second argument is a similar one from the menu, use the id of the similar one.
Separate each command with a "/"
user
Convert context to command.
You must follow example. as short as possible.
if context is about asking item info->info id
if context is about asking order list->ls
if context about agree->yes
if context about disagree->no
other context->-
- If second arg is exist, the arg declare follow list [${menu}]
- If the second argument is a similar one from the menu, use the id of the similar one.
Separate each command with a "/"
assistamt
Convert context to command.
You must follow example. as short as possible.
if context is about adding items from orderlist->add id count
if context is about removing items from orderlist->rm id count
if context is about state transition->st paying
other context->-
- If second arg is exist, the arg declare follow list [${menu}]
- If the second argument is a similar one from the menu, use the id of the similar one.
Separate each command with a "/"