Skip to content

[Bug]: Morph embedding function has snake cased arguments, open ai has camel cased #6201

@tjkrusinskichroma

Description

@tjkrusinskichroma

What happened?

It looks like the morph typescript package has snaked cased args whereas the other embedding function packages have camel cased args.

morph.d.ts:

import { EmbeddingFunction, EmbeddingFunctionSpace } from 'chromadb';

interface MorphConfig {
    api_key_env_var: string;
    model_name: string;
    api_base?: string;
    encoding_format?: 'float' | 'base64';
}
interface MorphEmbeddingFunctionConfig {
    api_key?: string;
    model_name?: string;
    api_base?: string;
    encoding_format?: 'float' | 'base64';
    api_key_env_var?: string;
}
declare class MorphEmbeddingFunction implements EmbeddingFunction {
    readonly name = "morph";
    private readonly apiKeyEnvVar;
    private readonly modelName;
    private readonly encodingFormat;
    private readonly apiBase;
    private client;
    constructor(config?: MorphEmbeddingFunctionConfig);
    generate(texts: string[]): Promise<number[][]>;
    defaultSpace(): EmbeddingFunctionSpace;
    supportedSpaces(): EmbeddingFunctionSpace[];
    static buildFromConfig(config: MorphConfig): MorphEmbeddingFunction;
    getConfig(): MorphConfig;
    validateConfigUpdate(newConfig: Record<string, any>): void;
    static validateConfig(config: MorphConfig): void;
}

export { type MorphConfig, MorphEmbeddingFunction, type MorphEmbeddingFunctionConfig };

openai.d.ts:

import { EmbeddingFunction, EmbeddingFunctionSpace } from 'chromadb';

interface OpenAIConfig {
    api_key_env_var?: string;
    model_name: string;
    organization_id?: string;
    dimensions?: number;
    api_base?: string;
}
interface OpenAIArgs {
    apiKeyEnvVar?: string;
    modelName: string;
    organizationId?: string;
    dimensions?: number;
    apiKey?: string;
    apiBase?: string;
}
declare class OpenAIEmbeddingFunction implements EmbeddingFunction {
    readonly name = "openai";
    private readonly apiKeyEnvVar;
    private readonly modelName;
    private readonly dimensions;
    private readonly organizationId;
    private readonly apiBase;
    private client;
    constructor(args: OpenAIArgs);
    generate(texts: string[]): Promise<number[][]>;
    defaultSpace(): EmbeddingFunctionSpace;
    supportedSpaces(): EmbeddingFunctionSpace[];
    static buildFromConfig(config: OpenAIConfig): OpenAIEmbeddingFunction;
    getConfig(): OpenAIConfig;
    validateConfigUpdate(newConfig: Record<string, any>): void;
    static validateConfig(config: OpenAIConfig): void;
}

export { type OpenAIArgs, type OpenAIConfig, OpenAIEmbeddingFunction };

cohere.d.ts

import { EmbeddingFunction, EmbeddingFunctionSpace } from 'chromadb';

type CohereEmbedInputType = "search_document" | "search_query" | "classification" | "clustering" | "image";
type CohereEmbedTruncate = "NONE" | "START" | "END";
type CohereEmbedEmbeddingType = "float" | "int8" | "uint8" | "binary" | "ubinary";
interface CohereConfig {
    model_name: string;
    api_key_env_var: string;
    input_type?: CohereEmbedInputType;
    truncate?: CohereEmbedTruncate;
    embedding_type?: CohereEmbedEmbeddingType;
    image?: boolean;
}
interface CohereArgs {
    apiKey?: string;
    apiKeyEnvVar?: string;
    modelName?: string;
    image?: boolean;
    inputType?: CohereEmbedInputType;
    truncate?: CohereEmbedTruncate;
    embeddingType?: CohereEmbedEmbeddingType;
}
declare class CohereEmbeddingFunction implements EmbeddingFunction {
    readonly name = "cohere";
    private readonly client;
    private readonly apiKeyEnvVar;
    private readonly modelName;
    private readonly inputType;
    private readonly truncate;
    private readonly embeddingType;
    private readonly image;
    constructor(args?: Partial<CohereArgs>);
    generate(texts: string[]): Promise<number[][]>;
    defaultSpace(): EmbeddingFunctionSpace;
    supportedSpaces(): EmbeddingFunctionSpace[];
    static buildFromConfig(config: CohereConfig): CohereEmbeddingFunction;
    getConfig(): CohereConfig;
    validateConfigUpdate(newConfig: Record<string, any>): void;
    static validateConfig(config: CohereConfig): void;
}

export { type CohereArgs, type CohereConfig, type CohereEmbedEmbeddingType, type CohereEmbedInputType, type CohereEmbedTruncate, CohereEmbeddingFunction };

Versions

@chroma-core/morph @ v0.1.8
@chroma-core/openai @ v0.1.9
@chroma-core/cohere @ v0.1.8

(both are latest in npm)

Relevant log output

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions