Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing endpoints for AI services #147

Merged
merged 6 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading