From 19d601b33e936edd2fc824194ebe2f5abedea64e Mon Sep 17 00:00:00 2001 From: Kristina Date: Fri, 8 Nov 2024 14:56:30 +0400 Subject: [PATCH] Love agent build (#7133) Signed-off-by: Kristina Fefelova --- .github/workflows/main.yml | 17 +++++ services/ai-bot/love-agent/package.json | 9 ++- services/ai-bot/love-agent/pnpm-lock.yaml | 93 +++++++++++++---------- services/ai-bot/love-agent/src/config.ts | 2 - 4 files changed, 77 insertions(+), 44 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 62ac467d57..f051325abe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -496,6 +496,9 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' + - uses: pnpm/action-setup@v4 + with: + version: latest - name: Cache node modules uses: actions/cache@v4 env: @@ -518,6 +521,14 @@ jobs: env: DOCKER_CLI_HINTS: false DOCKER_EXTRA: --platform=linux/amd64,linux/arm64 + - name: Docker build love-agent + run: | + cd ./services/ai-bot/love-agent + pnpm install && pnpm build + pnpm docker:build -v + env: + DOCKER_CLI_HINTS: false + DOCKER_EXTRA: --platform=linux/amd64,linux/arm64 - name: Login to Docker Hub if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/s') }} uses: docker/login-action@v3 @@ -532,6 +543,12 @@ jobs: run: | echo Pushing release of tag ${{ github.ref }} node common/scripts/install-run-rush.js docker:push -v + - name: Docker push love-agent + if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/s') }} + run: | + echo Pushing love-agent release of tag ${{ github.ref }} + cd ./services/ai-bot/love-agent + pnpm docker:push dist-build: # if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/s') }} if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/s') }} diff --git a/services/ai-bot/love-agent/package.json b/services/ai-bot/love-agent/package.json index 91f6daabbc..61a50862a0 100644 --- a/services/ai-bot/love-agent/package.json +++ b/services/ai-bot/love-agent/package.json @@ -13,10 +13,17 @@ "type": "module", "scripts": { "build": "node esbuild.config.js", + "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/love-agent", + "docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/love-agent", "lint": "eslint src/**/*.ts", "lint:fix": "eslint --fix src/**/*.ts", "format": "prettier --write src/**/*.ts && pnpm lint:fix" }, + "pnpm": { + "overrides": { + "livekit-server-sdk": "2.7.3" + } + }, "devDependencies": { "@types/node": "~20.11.16", "@typescript-eslint/eslint-plugin": "^6.11.0", @@ -32,7 +39,7 @@ "typescript": "^5.6.3" }, "dependencies": { - "@deepgram/sdk": "^3.8.1", + "@deepgram/sdk": "^3.9.0", "@livekit/agents": "^0.3.5", "@livekit/rtc-node": "^0.11.1", "dotenv": "^16.4.5" diff --git a/services/ai-bot/love-agent/pnpm-lock.yaml b/services/ai-bot/love-agent/pnpm-lock.yaml index 8dc77dc714..f6d11bcaa8 100644 --- a/services/ai-bot/love-agent/pnpm-lock.yaml +++ b/services/ai-bot/love-agent/pnpm-lock.yaml @@ -4,13 +4,16 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +overrides: + livekit-server-sdk: 2.7.3 + importers: .: dependencies: '@deepgram/sdk': - specifier: ^3.8.1 - version: 3.8.1 + specifier: ^3.9.0 + version: 3.9.0 '@livekit/agents': specifier: ^0.3.5 version: 0.3.5 @@ -70,8 +73,8 @@ packages: resolution: {integrity: sha512-8B1C/oTxTxyHlSFubAhNRgCbQ2SQ5wwvtlByn8sDYZvdDtdn/VE2yEPZ4BvUnrKWmsbTQY6/ooLV+9Ka2qmDSQ==} engines: {node: '>=18.0.0'} - '@deepgram/sdk@3.8.1': - resolution: {integrity: sha512-Q732JUp4tuBRpqOVnxC4MMARvQnxE963ftzF5pYPeQU/DDTAz3rty6yeGzjsZavPPr8mqySZ1RboU3FEIUvD+Q==} + '@deepgram/sdk@3.9.0': + resolution: {integrity: sha512-X/7JzoYjCObyEaPb2Dgnkwk2LwRe4bw0FJJCLdkjpnFfJCFgA9IWgRD8FEUI6/hp8dW/CqqXkGPA2Q3DIsVG8A==} engines: {node: '>=18.0.0'} '@esbuild/aix-ppc64@0.20.2': @@ -212,14 +215,14 @@ packages: cpu: [x64] os: [win32] - '@eslint-community/eslint-utils@4.4.0': - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + '@eslint-community/eslint-utils@4.4.1': + resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.11.1': - resolution: {integrity: sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==} + '@eslint-community/regexpp@4.12.1': + resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} '@eslint/eslintrc@2.1.4': @@ -249,8 +252,8 @@ packages: '@livekit/mutex@1.1.0': resolution: {integrity: sha512-XRLG+z/0uoyDioupjUiskjI06Y51U/IXVPJn7qJ+R3J75XX01irYVBM9MpxeJahpVoe9QhU4moIEolX+HO9U9g==} - '@livekit/protocol@1.27.0': - resolution: {integrity: sha512-jVb4zljNaYKoLiL5MBjGiO1+QKVsxMqXT/c0dwcKUW7NCLjAZXucoQVV1Y79FCbKwVnOCOtI6wwteEntbfk/Qw==} + '@livekit/protocol@1.27.1': + resolution: {integrity: sha512-ISEp7uWdV82mtCR1eyHFTzdRZTVbe2+ZztjmjiMPzR/KPrI1Ma/u5kLh87NNuY3Rn8wv1VlEvGHHsFjQ+dKVUw==} '@livekit/rtc-node-darwin-arm64@0.11.1': resolution: {integrity: sha512-M+Ui87H06ae19GGI7r937dS6hI84MBBTQAkkNlL7qd+pvdCAk25u0FYa8r4SOElKJ0VR3AbzeDoXTihLgpvjMg==} @@ -310,6 +313,9 @@ packages: '@types/json5@0.0.29': resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + '@types/node@18.19.64': + resolution: {integrity: sha512-955mDqvO2vFf/oL7V3WiUtiz+BugyX8uVbaT2H8oj3+8dRyH2FLiNdowe7eNqRM7IOIZvzDH76EoAT+gwm6aIQ==} + '@types/node@20.11.30': resolution: {integrity: sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==} @@ -386,8 +392,8 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn@8.13.0: - resolution: {integrity: sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w==} + acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} engines: {node: '>=0.4.0'} hasBin: true @@ -503,8 +509,8 @@ packages: cross-fetch@3.1.8: resolution: {integrity: sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==} - cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + cross-spawn@7.0.5: + resolution: {integrity: sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==} engines: {node: '>= 8'} data-view-buffer@1.0.1: @@ -1015,8 +1021,8 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} - livekit-server-sdk@2.7.2: - resolution: {integrity: sha512-qDNRXeo+WMnY5nKSug7KHJ9er9JIuKi+r7H9ZaSBbmbaOt62i0b4BrHBMFSMr8pAuWzuSxihCFa29q5QvFc5fw==} + livekit-server-sdk@2.7.3: + resolution: {integrity: sha512-dBiyMJ2o3Adw7aBVuFxVOlYHmiZtGGS9zVksMuv/wiEVHY+6XSDzo0X67pZVkyGlq1moF4YZAReVY2Dbxve8NQ==} engines: {node: '>=19'} locate-path@6.0.0: @@ -1331,8 +1337,8 @@ packages: tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - ts-api-utils@1.3.0: - resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + ts-api-utils@1.4.0: + resolution: {integrity: sha512-032cPxaEKwM+GT3vA5JXNzIaizx388rhsSW79vGRNGXfRRAdEAn2mvk36PvK5HnOchyWZ7afLEXqYCvPCrzuzQ==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' @@ -1436,9 +1442,10 @@ snapshots: dependencies: dayjs: 1.11.13 - '@deepgram/sdk@3.8.1': + '@deepgram/sdk@3.9.0': dependencies: '@deepgram/captions': 1.2.0 + '@types/node': 18.19.64 cross-fetch: 3.1.8 deepmerge: 4.3.1 events: 3.3.0 @@ -1517,12 +1524,12 @@ snapshots: '@esbuild/win32-x64@0.20.2': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@8.57.1)': + '@eslint-community/eslint-utils@4.4.1(eslint@8.57.1)': dependencies: eslint: 8.57.1 eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.11.1': {} + '@eslint-community/regexpp@4.12.1': {} '@eslint/eslintrc@2.1.4': dependencies: @@ -1555,10 +1562,10 @@ snapshots: '@livekit/agents@0.3.5': dependencies: '@livekit/mutex': 1.1.0 - '@livekit/protocol': 1.27.0 + '@livekit/protocol': 1.27.1 '@livekit/rtc-node': 0.11.1 commander: 12.1.0 - livekit-server-sdk: 2.7.2 + livekit-server-sdk: 2.7.3 pino: 8.21.0 pino-pretty: 11.3.0 ws: 8.18.0 @@ -1569,7 +1576,7 @@ snapshots: '@livekit/mutex@1.1.0': {} - '@livekit/protocol@1.27.0': + '@livekit/protocol@1.27.1': dependencies: '@bufbuild/protobuf': 1.10.0 @@ -1620,6 +1627,10 @@ snapshots: '@types/json5@0.0.29': {} + '@types/node@18.19.64': + dependencies: + undici-types: 5.26.5 + '@types/node@20.11.30': dependencies: undici-types: 5.26.5 @@ -1628,7 +1639,7 @@ snapshots: '@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3)': dependencies: - '@eslint-community/regexpp': 4.11.1 + '@eslint-community/regexpp': 4.12.1 '@typescript-eslint/parser': 6.21.0(eslint@8.57.1)(typescript@5.6.3) '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/type-utils': 6.21.0(eslint@8.57.1)(typescript@5.6.3) @@ -1640,7 +1651,7 @@ snapshots: ignore: 5.3.2 natural-compare: 1.4.0 semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.6.3) + ts-api-utils: 1.4.0(typescript@5.6.3) optionalDependencies: typescript: 5.6.3 transitivePeerDependencies: @@ -1670,7 +1681,7 @@ snapshots: '@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.6.3) debug: 4.3.7 eslint: 8.57.1 - ts-api-utils: 1.3.0(typescript@5.6.3) + ts-api-utils: 1.4.0(typescript@5.6.3) optionalDependencies: typescript: 5.6.3 transitivePeerDependencies: @@ -1687,7 +1698,7 @@ snapshots: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.6.3) + ts-api-utils: 1.4.0(typescript@5.6.3) optionalDependencies: typescript: 5.6.3 transitivePeerDependencies: @@ -1695,7 +1706,7 @@ snapshots: '@typescript-eslint/utils@6.21.0(eslint@8.57.1)(typescript@5.6.3)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1) + '@eslint-community/eslint-utils': 4.4.1(eslint@8.57.1) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 6.21.0 @@ -1718,11 +1729,11 @@ snapshots: dependencies: event-target-shim: 5.0.1 - acorn-jsx@5.3.2(acorn@8.13.0): + acorn-jsx@5.3.2(acorn@8.14.0): dependencies: - acorn: 8.13.0 + acorn: 8.14.0 - acorn@8.13.0: {} + acorn@8.14.0: {} ajv@6.12.6: dependencies: @@ -1863,7 +1874,7 @@ snapshots: transitivePeerDependencies: - encoding - cross-spawn@7.0.3: + cross-spawn@7.0.5: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 @@ -2151,8 +2162,8 @@ snapshots: eslint@8.57.1: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1) - '@eslint-community/regexpp': 4.11.1 + '@eslint-community/eslint-utils': 4.4.1(eslint@8.57.1) + '@eslint-community/regexpp': 4.12.1 '@eslint/eslintrc': 2.1.4 '@eslint/js': 8.57.1 '@humanwhocodes/config-array': 0.13.0 @@ -2161,7 +2172,7 @@ snapshots: '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 - cross-spawn: 7.0.3 + cross-spawn: 7.0.5 debug: 4.3.7 doctrine: 3.0.0 escape-string-regexp: 4.0.0 @@ -2194,8 +2205,8 @@ snapshots: espree@9.6.1: dependencies: - acorn: 8.13.0 - acorn-jsx: 5.3.2(acorn@8.13.0) + acorn: 8.14.0 + acorn-jsx: 5.3.2(acorn@8.14.0) eslint-visitor-keys: 3.4.3 esquery@1.6.0: @@ -2477,9 +2488,9 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 - livekit-server-sdk@2.7.2: + livekit-server-sdk@2.7.3: dependencies: - '@livekit/protocol': 1.27.0 + '@livekit/protocol': 1.27.1 camelcase-keys: 9.1.3 jose: 5.9.6 @@ -2800,7 +2811,7 @@ snapshots: tr46@0.0.3: {} - ts-api-utils@1.3.0(typescript@5.6.3): + ts-api-utils@1.4.0(typescript@5.6.3): dependencies: typescript: 5.6.3 diff --git a/services/ai-bot/love-agent/src/config.ts b/services/ai-bot/love-agent/src/config.ts index f3b4ecaaec..249aee3a6a 100644 --- a/services/ai-bot/love-agent/src/config.ts +++ b/services/ai-bot/love-agent/src/config.ts @@ -14,7 +14,6 @@ // interface Config { - Port: number TranscriptDelay: number DeepgramApiKey: string PlatformUrl: string @@ -25,7 +24,6 @@ const parseNumber = (str: string | undefined): number | undefined => (str !== un const config: Config = (() => { const params: Partial = { - Port: parseNumber(process.env.PORT) ?? 4020, DeepgramApiKey: process.env.DEEPGRAM_API_KEY, TranscriptDelay: parseNumber(process.env.TRANSCRIPT_DELAY) ?? 3000, PlatformUrl: process.env.PLATFORM_URL,