mirror of
https://github.com/leon-ai/leon.git
synced 2024-12-18 22:31:32 +03:00
feat(bridge/nodejs): add leon.getVersions
This commit is contained in:
parent
2c2f49290a
commit
ec819e1765
@ -1,9 +1,15 @@
|
||||
import type { AnswerData, AnswerInput, AnswerOutput } from '@sdk/types'
|
||||
import type {
|
||||
AnswerData,
|
||||
AnswerInput,
|
||||
AnswerOutput,
|
||||
Versions
|
||||
} from '@sdk/types'
|
||||
import {
|
||||
INTENT_OBJECT,
|
||||
SKILL_CONFIG,
|
||||
SKILL_SRC_CONFIG
|
||||
} from '@bridge/constants'
|
||||
import { VERSION } from '@bridge/version'
|
||||
|
||||
class Leon {
|
||||
private static instance: Leon
|
||||
@ -107,6 +113,16 @@ class Leon {
|
||||
console.error('Error while creating answer:', e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the versions of the core and the bridge.
|
||||
*/
|
||||
public async getVersions(): Promise<Versions> {
|
||||
return {
|
||||
core: process.env['npm_package_version'] ?? 'unknown',
|
||||
'nodejs-bridge': VERSION
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const leon = new Leon()
|
||||
|
@ -7,6 +7,11 @@ export type { ActionParams, IntentObject }
|
||||
|
||||
export type ActionFunction = (params: ActionParams) => Promise<void>
|
||||
|
||||
export interface Versions {
|
||||
core: string
|
||||
'nodejs-bridge': string
|
||||
}
|
||||
|
||||
/**
|
||||
* Answer types
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user