fix linting errors

This commit is contained in:
Ishaan Jaff 2025-04-14 20:03:39 -07:00
parent 9b714ae230
commit 903f792777
3 changed files with 11 additions and 4 deletions

View file

@ -25,7 +25,7 @@ class AnthropicCacheControlHook(CustomPromptManagement):
model: str,
messages: List[AllMessageValues],
non_default_params: dict,
prompt_id: str,
prompt_id: Optional[str],
prompt_variables: Optional[dict],
dynamic_callback_params: StandardCallbackDynamicParams,
) -> Tuple[str, List[AllMessageValues], dict]:

View file

@ -152,10 +152,14 @@ class HumanloopLogger(CustomLogger):
model: str,
messages: List[AllMessageValues],
non_default_params: dict,
prompt_id: str,
prompt_id: Optional[str],
prompt_variables: Optional[dict],
dynamic_callback_params: StandardCallbackDynamicParams,
) -> Tuple[str, List[AllMessageValues], dict,]:
) -> Tuple[
str,
List[AllMessageValues],
dict,
]:
humanloop_api_key = dynamic_callback_params.get(
"humanloop_api_key"
) or get_secret_str("HUMANLOOP_API_KEY")
@ -170,6 +174,9 @@ class HumanloopLogger(CustomLogger):
dynamic_callback_params=dynamic_callback_params,
)
if prompt_id is None:
raise ValueError("prompt_id is required for Humanloop integration")
prompt_template = prompt_manager._get_prompt_from_id(
humanloop_prompt_id=prompt_id, humanloop_api_key=humanloop_api_key
)

View file

@ -30,7 +30,7 @@ class TestCustomPromptManagement(CustomPromptManagement):
model: str,
messages: List[AllMessageValues],
non_default_params: dict,
prompt_id: str,
prompt_id: Optional[str],
prompt_variables: Optional[dict],
dynamic_callback_params: StandardCallbackDynamicParams,
) -> Tuple[str, List[AllMessageValues], dict]: