@mozaik-ai/core 4.0.0-beta.5 → 4.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -189,6 +189,11 @@ type ModelSpecification = {
189
189
  supportsStructuredOutput: boolean;
190
190
  };
191
191
 
192
+ interface RequestValidationRule {
193
+ readonly name: string;
194
+ isValid(inferenceInput: InferenceInput, model: ModelSpecification): boolean;
195
+ }
196
+
192
197
  type StructuredOutputFormat = {
193
198
  name?: string;
194
199
  schema: Record<string, any>;
@@ -526,4 +531,18 @@ declare class GeminiGenerateContent implements Endpoint {
526
531
  stream(inferenceInput: InferenceInput): AsyncIterable<SemanticEvent>;
527
532
  }
528
533
 
529
- export { Agent, AnthropicMessages, ContextItem, DeveloperMessageItem, type Endpoint, FunctionCallItem, FunctionCallOutputItem, GeminiGenerateContent, Human, type InferenceInput, type InferenceOutput, type InferenceRunner, type InferenceRunnerConfig, InputTokenDetails, McpClient, type McpServerConfig, McpToolRegistry, type McpToolSpec, ModelContext, type ModelContextRepository, ModelMessageItem, OpenAIChatCompletions, OpenAIResponses, OutputTokenDetails, Participant, ReasoningItem, RuntimeState, SemanticEvent, type SituationContext, type SituationHandler, type SituationProcessor, SituationSpecification, type StructuredOutputFormat, SystemMessageItem, TokenUsage, type Tool, UserMessageItem, createAgent, createHuman, defineRuntime, supportedModels };
534
+ declare class InferenceInputValidator {
535
+ private readonly rules;
536
+ constructor(rules?: RequestValidationRule[]);
537
+ validate(inferenceInput: InferenceInput, model: ModelSpecification): void;
538
+ }
539
+
540
+ declare class DefaultInferenceRunner implements InferenceRunner {
541
+ private readonly supportedModels;
542
+ private readonly requestValidator;
543
+ constructor(supportedModels: GenerativeModel[], requestValidator: InferenceInputValidator);
544
+ run(input: InferenceInput): Promise<InferenceOutput>;
545
+ stream(input: InferenceInput): AsyncGenerator<SemanticEvent>;
546
+ }
547
+
548
+ export { Agent, AnthropicMessages, ContextItem, DefaultInferenceRunner, DeveloperMessageItem, type Endpoint, FunctionCallItem, FunctionCallOutputItem, GeminiGenerateContent, Human, type InferenceInput, type InferenceOutput, type InferenceRunner, type InferenceRunnerConfig, InputTokenDetails, McpClient, type McpServerConfig, McpToolRegistry, type McpToolSpec, ModelContext, type ModelContextRepository, ModelMessageItem, OpenAIChatCompletions, OpenAIResponses, OutputTokenDetails, Participant, ReasoningItem, RuntimeState, SemanticEvent, type SituationContext, type SituationHandler, type SituationProcessor, SituationSpecification, type StructuredOutputFormat, SystemMessageItem, TokenUsage, type Tool, UserMessageItem, createAgent, createHuman, defineRuntime, supportedModels };
package/dist/index.d.ts CHANGED
@@ -189,6 +189,11 @@ type ModelSpecification = {
189
189
  supportsStructuredOutput: boolean;
190
190
  };
191
191
 
192
+ interface RequestValidationRule {
193
+ readonly name: string;
194
+ isValid(inferenceInput: InferenceInput, model: ModelSpecification): boolean;
195
+ }
196
+
192
197
  type StructuredOutputFormat = {
193
198
  name?: string;
194
199
  schema: Record<string, any>;
@@ -526,4 +531,18 @@ declare class GeminiGenerateContent implements Endpoint {
526
531
  stream(inferenceInput: InferenceInput): AsyncIterable<SemanticEvent>;
527
532
  }
528
533
 
529
- export { Agent, AnthropicMessages, ContextItem, DeveloperMessageItem, type Endpoint, FunctionCallItem, FunctionCallOutputItem, GeminiGenerateContent, Human, type InferenceInput, type InferenceOutput, type InferenceRunner, type InferenceRunnerConfig, InputTokenDetails, McpClient, type McpServerConfig, McpToolRegistry, type McpToolSpec, ModelContext, type ModelContextRepository, ModelMessageItem, OpenAIChatCompletions, OpenAIResponses, OutputTokenDetails, Participant, ReasoningItem, RuntimeState, SemanticEvent, type SituationContext, type SituationHandler, type SituationProcessor, SituationSpecification, type StructuredOutputFormat, SystemMessageItem, TokenUsage, type Tool, UserMessageItem, createAgent, createHuman, defineRuntime, supportedModels };
534
+ declare class InferenceInputValidator {
535
+ private readonly rules;
536
+ constructor(rules?: RequestValidationRule[]);
537
+ validate(inferenceInput: InferenceInput, model: ModelSpecification): void;
538
+ }
539
+
540
+ declare class DefaultInferenceRunner implements InferenceRunner {
541
+ private readonly supportedModels;
542
+ private readonly requestValidator;
543
+ constructor(supportedModels: GenerativeModel[], requestValidator: InferenceInputValidator);
544
+ run(input: InferenceInput): Promise<InferenceOutput>;
545
+ stream(input: InferenceInput): AsyncGenerator<SemanticEvent>;
546
+ }
547
+
548
+ export { Agent, AnthropicMessages, ContextItem, DefaultInferenceRunner, DeveloperMessageItem, type Endpoint, FunctionCallItem, FunctionCallOutputItem, GeminiGenerateContent, Human, type InferenceInput, type InferenceOutput, type InferenceRunner, type InferenceRunnerConfig, InputTokenDetails, McpClient, type McpServerConfig, McpToolRegistry, type McpToolSpec, ModelContext, type ModelContextRepository, ModelMessageItem, OpenAIChatCompletions, OpenAIResponses, OutputTokenDetails, Participant, ReasoningItem, RuntimeState, SemanticEvent, type SituationContext, type SituationHandler, type SituationProcessor, SituationSpecification, type StructuredOutputFormat, SystemMessageItem, TokenUsage, type Tool, UserMessageItem, createAgent, createHuman, defineRuntime, supportedModels };
package/dist/index.js CHANGED
@@ -33,6 +33,7 @@ __export(index_exports, {
33
33
  Agent: () => Agent,
34
34
  AnthropicMessages: () => AnthropicMessages,
35
35
  ContextItem: () => ContextItem,
36
+ DefaultInferenceRunner: () => DefaultInferenceRunner,
36
37
  DeveloperMessageItem: () => DeveloperMessageItem,
37
38
  FunctionCallItem: () => FunctionCallItem,
38
39
  FunctionCallOutputItem: () => FunctionCallOutputItem,
@@ -855,34 +856,27 @@ var EventPublisherLoopVisitor = class {
855
856
  this.runtime = runtime;
856
857
  }
857
858
  visitContextPreparationStarted(input) {
858
- console.log("Visiting message received started: ", input);
859
859
  this.publish("context_preparation.started", input);
860
860
  }
861
861
  visitContextPreparationCompleted(output) {
862
- console.log("Visiting message received completed: ", output);
863
862
  this.publish("context_preparation.completed", output);
864
863
  }
865
864
  visitInferenceStarted(input) {
866
- console.log("Visiting inference started: ", input);
867
865
  this.publish("inference.started", input);
868
866
  }
869
867
  visitInferenceEvent(event) {
870
868
  this.publish("inference.stream", event);
871
869
  }
872
870
  visitInferenceCompleted(output) {
873
- console.log("Visiting inference completed: ", output);
874
871
  this.publish("inference.completed", output);
875
872
  }
876
873
  visitFunctionCallStarted(input) {
877
- console.log("Visiting function call started: ", input);
878
874
  this.publish("function_call.started", input);
879
875
  }
880
876
  visitFunctionCallCompleted(output) {
881
- console.log("Visiting function call completed: ", output);
882
877
  this.publish("function_call.completed", output);
883
878
  }
884
879
  visitModelAnswer(input) {
885
- console.log("Visiting model answer: ", input.answer);
886
880
  this.publish("model.answer", input);
887
881
  }
888
882
  publish(type, payload) {
@@ -2218,6 +2212,7 @@ var NotSituationSpecification = class extends SituationSpecification {
2218
2212
  Agent,
2219
2213
  AnthropicMessages,
2220
2214
  ContextItem,
2215
+ DefaultInferenceRunner,
2221
2216
  DeveloperMessageItem,
2222
2217
  FunctionCallItem,
2223
2218
  FunctionCallOutputItem,