mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
add types for BedrockMessage
This commit is contained in:
parent
65c0626aa4
commit
14a6ce367d
1 changed files with 20 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from enum import Enum
|
||||
from typing import Dict, List, Optional, TypedDict
|
||||
from typing import Dict, List, Literal, Optional, TypedDict
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
|
@ -76,8 +76,14 @@ class LitellmParams(TypedDict, total=False):
|
|||
mode: str
|
||||
api_key: str
|
||||
api_base: Optional[str]
|
||||
|
||||
# Lakera specific params
|
||||
category_thresholds: Optional[LakeraCategoryThresholds]
|
||||
|
||||
# Bedrock specific params
|
||||
guardrailIdentifier: Optional[str]
|
||||
guardrailVersion: Optional[str]
|
||||
|
||||
|
||||
class Guardrail(TypedDict):
|
||||
guardrail_name: str
|
||||
|
|
@ -92,3 +98,16 @@ class GuardrailEventHooks(str, Enum):
|
|||
pre_call = "pre_call"
|
||||
post_call = "post_call"
|
||||
during_call = "during_call"
|
||||
|
||||
|
||||
class BedrockTextContent(TypedDict):
|
||||
text: str
|
||||
|
||||
|
||||
class BedrockContentItem(TypedDict):
|
||||
text: BedrockTextContent
|
||||
|
||||
|
||||
class BedrockMessage(TypedDict):
|
||||
source: Literal["INPUT", "OUTPUT"]
|
||||
content: List[BedrockContentItem]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue