types add GuardrailConfigBlock

This commit is contained in:
Ishaan Jaff 2024-07-29 13:14:53 -07:00
parent 31445ab20a
commit 3eaa1fa217

View file

@ -1,16 +1,18 @@
from typing import TypedDict, Any, Union, Optional, Literal, List
import json import json
from .openai import ChatCompletionToolCallChunk from typing import Any, List, Literal, Optional, TypedDict, Union
from typing_extensions import ( from typing_extensions import (
Self,
Protocol, Protocol,
TypeGuard,
override,
get_origin,
runtime_checkable,
Required, Required,
Self,
TypeGuard,
get_origin,
override,
runtime_checkable,
) )
from .openai import ChatCompletionToolCallChunk
class SystemContentBlock(TypedDict): class SystemContentBlock(TypedDict):
text: str text: str
@ -108,6 +110,12 @@ class ToolConfigBlock(TypedDict, total=False):
toolChoice: Union[str, ToolChoiceValuesBlock] toolChoice: Union[str, ToolChoiceValuesBlock]
class GuardrailConfigBlock(TypedDict, total=False):
guardrailIdentifier: str
guardrailVersion: str
trace: Literal["enabled", "disabled"]
class InferenceConfig(TypedDict, total=False): class InferenceConfig(TypedDict, total=False):
maxTokens: int maxTokens: int
stopSequences: List[str] stopSequences: List[str]
@ -144,6 +152,7 @@ class RequestObject(TypedDict, total=False):
messages: Required[List[MessageBlock]] messages: Required[List[MessageBlock]]
system: List[SystemContentBlock] system: List[SystemContentBlock]
toolConfig: ToolConfigBlock toolConfig: ToolConfigBlock
guardrailConfig: Optional[GuardrailConfigBlock]
class GenericStreamingChunk(TypedDict): class GenericStreamingChunk(TypedDict):