feat: 引入deepseek结构化输出
This commit is contained in:
@@ -45,10 +45,12 @@ class MemoirImagePromptingTest(unittest.TestCase):
|
||||
liblib_template_uuid="tpl-uuid",
|
||||
)
|
||||
llm = Mock()
|
||||
llm.invoke.return_value.content = (
|
||||
bound_llm = Mock()
|
||||
bound_llm.invoke.return_value.content = (
|
||||
'{"prompt":"A grandmother in a quiet courtyard, summer cicadas, soft watercolor",'
|
||||
'"style":"watercolor","size":"1024x1024"}'
|
||||
)
|
||||
llm.bind.return_value = bound_llm
|
||||
service = MemoirImagePromptService(llm=llm, settings=settings)
|
||||
|
||||
result = service.build_prompt(
|
||||
@@ -74,13 +76,15 @@ class MemoirImagePromptingTest(unittest.TestCase):
|
||||
liblib_template_uuid="tpl-uuid",
|
||||
)
|
||||
llm = Mock()
|
||||
llm.invoke.return_value.content = """```json
|
||||
bound_llm = Mock()
|
||||
bound_llm.invoke.return_value.content = """```json
|
||||
{
|
||||
"prompt": "A middle-aged teacher stands on the empty stage, realistic, cinematic lighting",
|
||||
"style": "realistic",
|
||||
"size": "1280x720"
|
||||
}
|
||||
```"""
|
||||
llm.bind.return_value = bound_llm
|
||||
service = MemoirImagePromptService(llm=llm, settings=settings)
|
||||
|
||||
result = service.build_prompt(
|
||||
@@ -112,7 +116,9 @@ class MemoirImagePromptingTest(unittest.TestCase):
|
||||
liblib_template_uuid="tpl-uuid",
|
||||
)
|
||||
llm = Mock()
|
||||
llm.invoke.return_value.content = "not-json"
|
||||
bound_llm = Mock()
|
||||
bound_llm.invoke.return_value.content = "not-json"
|
||||
llm.bind.return_value = bound_llm
|
||||
service = MemoirImagePromptService(llm=llm, settings=settings)
|
||||
|
||||
result = service.build_prompt(
|
||||
|
||||
Reference in New Issue
Block a user