Skip to content

Commit

Permalink
Merge pull request #195 from weaviate/modules/add-missing-features-1609
Browse files Browse the repository at this point in the history
Add support for new modules
  • Loading branch information
tsmith023 authored Sep 16, 2024
2 parents 4e73ae0 + e27fbfc commit e333dab
Show file tree
Hide file tree
Showing 10 changed files with 490 additions and 88 deletions.
79 changes: 65 additions & 14 deletions src/collections/config/types/generative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,44 @@ export type GenerativeAWSConfig = {
endpoint?: string;
};

export type GenerativeAnthropicConfig = {
maxTokens?: number;
model?: string;
stopSequences?: string[];
temperature?: number;
topK?: number;
topP?: number;
};

export type GenerativeAnyscaleConfig = {
model?: string;
temperature?: number;
};

export type GenerativeCohereConfig = {
kProperty?: number;
model?: string;
maxTokensProperty?: number;
returnLikelihoodsProperty?: string;
stopSequencesProperty?: string[];
temperatureProperty?: number;
};

export type GenerativeDatabricksConfig = {
endpoint: string;
maxTokens?: number;
temperature?: number;
topK?: number;
topP?: number;
};

export type GenerativeFriendliAIConfig = {
baseURL?: string;
maxTokens?: number;
model?: string;
temperature?: number;
};

export type GenerativeMistralConfig = {
maxTokens?: number;
model?: string;
Expand Down Expand Up @@ -46,15 +79,6 @@ export type GenerativeAzureOpenAIConfig = GenerativeOpenAIConfigBase & {
deploymentId: string;
};

export type GenerativeCohereConfig = {
kProperty?: number;
model?: string;
maxTokensProperty?: number;
returnLikelihoodsProperty?: string;
stopSequencesProperty?: string[];
temperatureProperty?: number;
};

export type GenerativePaLMConfig = {
apiEndpoint?: string;
maxOutputTokens?: number;
Expand All @@ -66,30 +90,57 @@ export type GenerativePaLMConfig = {
};

export type GenerativeConfig =
| GenerativeOpenAIConfig
| GenerativeAnthropicConfig
| GenerativeAnyscaleConfig
| GenerativeAWSConfig
| GenerativeAzureOpenAIConfig
| GenerativeCohereConfig
| GenerativeMistralConfig
| GenerativeOctoAIConfig
| GenerativeOllamaConfig
| GenerativeOpenAIConfig
| GenerativePaLMConfig
| Record<string, any>
| undefined;

export type GenerativeConfigType<G> = G extends 'generative-openai'
export type GenerativeConfigType<G> = G extends 'generative-anthropic'
? GenerativeAnthropicConfig
: G extends 'generative-anyscale'
? GenerativeAnyscaleConfig
: G extends 'generative-aws'
? GenerativeAWSConfig
: G extends 'generative-azure-openai'
? GenerativeOpenAIConfig
: G extends 'generative-cohere'
? GenerativeCohereConfig
: G extends 'generative-palm'
? GenerativeAzureOpenAIConfig
: G extends 'generative-databricks'
? GenerativeDatabricksConfig
: G extends 'generative-friendliai'
? GenerativeFriendliAIConfig
: G extends 'generative-mistral'
? GenerativeMistralConfig
: G extends 'generative-octoai'
? GenerativeOctoAIConfig
: G extends 'generative-ollama'
? GenerativeOllamaConfig
: G extends 'generative-openai'
? GenerativePaLMConfig
: G extends 'none'
? undefined
: Record<string, any> | undefined;

export type GenerativeSearch =
| 'generative-anthropic'
| 'generative-anyscale'
| 'generative-aws'
| 'generative-azure-openai'
| 'generative-cohere'
| 'generative-databricks'
| 'generative-friendliai'
| 'generative-mistral'
| 'generative-octoai'
| 'generative-ollama'
| 'generative-openai'
| 'generative-cohere'
| 'generative-palm'
| 'none'
| string;
1 change: 1 addition & 0 deletions src/collections/config/types/reranker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type RerankerJinaAIConfig = {

export type RerankerConfig =
| RerankerCohereConfig
| RerankerJinaAIConfig
| RerankerTransformersConfig
| RerankerVoyageAIConfig
| Record<string, any>
Expand Down
Loading

0 comments on commit e333dab

Please sign in to comment.