Skip to content

Commit

Permalink
Merge pull request #147 from yandex-cloud/feature/endpoints-ai
Browse files Browse the repository at this point in the history
fix: add missing endpoints for AI services
  • Loading branch information
DavyJohnes authored Oct 20, 2023
2 parents 79ac104 + 37dd72c commit ecb796e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/actions/checkout-and-install-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ runs:
with:
fetch-depth: 0
persist-credentials: ${{ inputs.persist-credentials }}
submodules: ${{ inputs.submodules }}
- uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,25 @@ jobs:
tests:
runs-on: ubuntu-20.04
steps:
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@f69248b52b7991214847e889f28ba0883ed0ca2c
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@9fc72bb2948886090f84c9236580fbca480bdea7
- run: npm run test
# check-endpoints:
# runs-on: ubuntu-20.04
# steps:
# - uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@f69248b52b7991214847e889f28ba0883ed0ca2c
# - run: npm run check-endpoints
check-endpoints:
runs-on: ubuntu-20.04
# Currently, the check-endpoints script fails on the master branch.
# So we need to continue on error.
continue-on-error: true
steps:
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@9fc72bb2948886090f84c9236580fbca480bdea7
with:
submodules: recursive
- run: npm run check-endpoints
lint:
runs-on: ubuntu-20.04
steps:
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@f69248b52b7991214847e889f28ba0883ed0ca2c
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@9fc72bb2948886090f84c9236580fbca480bdea7
- run: npm run lint
build:
runs-on: ubuntu-20.04
steps:
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@f69248b52b7991214847e889f28ba0883ed0ca2c
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@9fc72bb2948886090f84c9236580fbca480bdea7
- run: npm run build
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Release
runs-on: ubuntu-20.04
steps:
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@f69248b52b7991214847e889f28ba0883ed0ca2c
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@9fc72bb2948886090f84c9236580fbca480bdea7
with:
persist-credentials: false
- env:
Expand Down
22 changes: 18 additions & 4 deletions src/service-endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
ServiceClientConstructor,
ServiceDefinition,
} from '@grpc/grpc-js';
import { ServiceClientConstructor, ServiceDefinition } from '@grpc/grpc-js';
import { GeneratedServiceClientCtor } from './types';

interface ServiceEndpoint {
Expand All @@ -17,6 +14,15 @@ export const SERVICE_ENDPOINTS_LIST: ServiceEndpointsList = [
serviceIds: ['yandex.cloud.operation.OperationService'],
endpoint: 'operation.api.cloud.yandex.net:443',
},
{
serviceIds: [
'yandex.cloud.ai.llm.v1alpha.EmbeddingsService',
'yandex.cloud.ai.llm.v1alpha.TextGenerationAsyncService',
'yandex.cloud.ai.llm.v1alpha.TextGenerationService',
'yandex.cloud.ai.llm.v1alpha.TokenizerService',
],
endpoint: 'llm.api.cloud.yandex.net:443',
},
{
serviceIds: [
'yandex.cloud.backup.v1.BackupService',
Expand Down Expand Up @@ -287,6 +293,7 @@ export const SERVICE_ENDPOINTS_LIST: ServiceEndpointsList = [
{
serviceIds: [
'yandex.cloud.ai.ocr.v1.TextRecognitionService',
'yandex.cloud.ai.ocr.v1.TextRecognitionAsyncService',
],
endpoint: 'ocr.api.cloud.yandex.net:443',
},
Expand Down Expand Up @@ -412,6 +419,13 @@ export const SERVICE_ENDPOINTS_LIST: ServiceEndpointsList = [
],
endpoint: 'loadtesting.api.cloud.yandex.net:443',
},
{
serviceIds: [
'speechkit.stt.v3.AsyncRecognizer',
'speechkit.stt.v3.Recognizer',
],
endpoint: 'stt.api.cloud.yandex.net:443',
},
];

export const getServiceClientEndpoint = <T extends ServiceDefinition>(generatedClientCtor: GeneratedServiceClientCtor<T>): string => {
Expand Down

0 comments on commit ecb796e

Please sign in to comment.