diff --git a/promptmodel/chat_model.py b/promptmodel/chat_model.py index a47ce9e..070b1db 100644 --- a/promptmodel/chat_model.py +++ b/promptmodel/chat_model.py @@ -107,6 +107,26 @@ def get_config(self) -> ChatModelConfig: ) return ChatModelConfig(prompt, version_detail, message_logs) + def get_prompts(self) -> str: + """Get prompts for the ChatModel. (Deprecated) + Returns: + str: system prompt for the ChatModel. + """ + prompt, version_detail, message_logs = run_async_in_sync( + LLMProxy.fetch_chat_model(self.name, self.session_uuid, self.version) + ) + return prompt + + def get_messages(self) -> List[Dict[str, Any]]: + """Get message logs for the ChatModel. (Deprecated) + Returns: + List[Dict[str, Any]]: messages for the ChatModel. + """ + prompt, version_detail, message_logs = run_async_in_sync( + LLMProxy.fetch_chat_model(self.name, self.session_uuid, self.version) + ) + return message_logs + @check_connection_status_decorator def add_messages( self, diff --git a/promptmodel/function_model.py b/promptmodel/function_model.py index 028ef0d..f0b005a 100644 --- a/promptmodel/function_model.py +++ b/promptmodel/function_model.py @@ -97,6 +97,19 @@ def get_config(self, *args, **kwargs) -> FunctionModelConfig: ) return FunctionModelConfig(prompt, version_detail) + @check_connection_status_decorator + def get_prompts(self, *args, **kwargs) -> List[Dict[str, Any]]: + """Get prompts for the promptmodel. (Deprecated) + Returns: + List[Dict]: prompts + """ + # add name to the list of function_models + + prompt, version_detail = run_async_in_sync( + LLMProxy.fetch_prompts(self.name, self.version) + ) + return prompt + @check_connection_status_decorator def run( self,