Skip to content

Commit

Permalink
[Rule Migration] Add inference connector as supported LLM type (elast…
Browse files Browse the repository at this point in the history
…ic#208032)

## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.

Adds .inference as a supported type, so it can be tested with EIS both
with custom providers and the default EIS provider.
  • Loading branch information
P1llus authored Jan 23, 2025
1 parent cc38fbe commit 811c539
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
* 2.0.
*/

export const AIActionTypeIds = ['.bedrock', '.gen-ai', '.gemini'];
export const AIActionTypeIds = ['.bedrock', '.gen-ai', '.gemini', '.inference'];
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
* 2.0.
*/

import type { ActionsClient } from '@kbn/actions-plugin/server';
import type { Logger } from '@kbn/core/server';
import type { ActionsClientSimpleChatModel } from '@kbn/langchain/server';
import {
ActionsClientBedrockChatModel,
ActionsClientChatOpenAI,
ActionsClientChatVertexAI,
} from '@kbn/langchain/server';
import type { Logger } from '@kbn/core/server';
import type { ActionsClient } from '@kbn/actions-plugin/server';
import type { ActionsClientChatOpenAIParams } from '@kbn/langchain/server/language_models/chat_openai';
import type { CustomChatModelInput as ActionsClientBedrockChatModelParams } from '@kbn/langchain/server/language_models/bedrock_chat';
import type { ActionsClientChatOpenAIParams } from '@kbn/langchain/server/language_models/chat_openai';
import type { CustomChatModelInput as ActionsClientChatVertexAIParams } from '@kbn/langchain/server/language_models/gemini_chat';
import type { CustomChatModelInput as ActionsClientSimpleChatModelParams } from '@kbn/langchain/server/language_models/simple_chat_model';

Expand All @@ -39,6 +39,7 @@ const llmTypeDictionary: Record<string, string> = {
[`.gen-ai`]: `openai`,
[`.bedrock`]: `bedrock`,
[`.gemini`]: `gemini`,
[`.inference`]: `inference`,
};

export class ActionsClientChat {
Expand Down Expand Up @@ -83,6 +84,7 @@ export class ActionsClientChat {
case 'gemini':
return ActionsClientChatVertexAI;
case 'openai':
case 'inference':
default:
return ActionsClientChatOpenAI;
}
Expand Down

0 comments on commit 811c539

Please sign in to comment.