Skip to content
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
8 changes: 7 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,13 @@ export { GantryClient, type Gantry } from './components/gantry';
*/
export * as gantryApi from './gen/component/gantry/v1/gantry_pb';

export { MLModelClient, type MLModel } from './services/ml-model';
export {
MLModelClient,
type MLModel,
type Metadata,
type TensorInfo,
type FlatTensors,
} from './services/ml-model';

export { MotorClient, type Motor } from './components/motor';
/**
Expand Down
3 changes: 2 additions & 1 deletion src/services/ml-model/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import { MLModelService } from '../../gen/service/mlmodel/v1/mlmodel_connect';

export class MLModelClient implements MLModel {
private client: PromiseClient<typeof MLModelService>;
private readonly name: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Not sure why it was private to begin with

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally this would be caught because we would extend Resource which requires name to be public. But the MLModelService does not implement the doCommand, which is a requirement for a Resource. So the type-checker didn't yell at me when I missed it last time.

private readonly options: Options;

public readonly name: string;
public callOptions: CallOptions = { headers: {} as Record<string, string> };

constructor(client: RobotClient, name: string, options: Options = {}) {
Expand Down
2 changes: 1 addition & 1 deletion src/services/ml-model/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export type { MLModel, FlatTensors } from './ml-model';
export type { MLModel, Metadata, FlatTensors, TensorInfo } from './ml-model';
export { MLModelClient } from './client';
2 changes: 2 additions & 0 deletions src/services/ml-model/ml-model.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { Struct } from '@bufbuild/protobuf';
import type * as mlModelAPI from '../../gen/service/mlmodel/v1/mlmodel_pb';

export type Metadata = mlModelAPI.Metadata;
export type TensorInfo = mlModelAPI.TensorInfo;
export type FlatTensors = mlModelAPI.FlatTensors;

export interface MLModel {
Expand Down