Skip to content

Commit 0588f97

Browse files
committed
finalized structured ouputs and agentic execution - with formatting corrections
1 parent 3523bbc commit 0588f97

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

runtime/prompty/prompty/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ def _convert_output_object(output: OutputProperty) -> dict[str, typing.Any]:
7474
if output.type == "array":
7575
if output.items is None:
7676
raise ValueError("Array type must have items defined")
77-
77+
7878
o = _convert_output_object(output.items)
7979
if "name" in o:
8080
o.pop("name")
81-
81+
8282
return {
8383
"type": "array",
8484
"items": o,

runtime/prompty/prompty/core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,6 @@ def _load_output(attributes: dict) -> OutputProperty:
597597
attributes["properties"] = properties
598598

599599
return OutputProperty(**attributes)
600-
601600

602601
@staticmethod
603602
def load_raw(attributes: dict, file: Path) -> "Prompty":

runtime/prompty/prompty/invoker.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ async def run_async(self, data: typing.Any) -> typing.Any:
306306
return self.process(parsed)
307307

308308

309-
310309
InvokerTypes = Literal["renderer", "parser", "executor", "processor"]
311310

312311

@@ -334,7 +333,6 @@ def add_executor(cls, name: str, invoker: type[Invoker]) -> None:
334333
def add_processor(cls, name: str, invoker: type[Invoker]) -> None:
335334
cls._processors[name] = invoker
336335

337-
338336
@classmethod
339337
def register_renderer(cls, name: str) -> Callable:
340338

@@ -371,7 +369,6 @@ def inner_wrapper(wrapped_class: type[Invoker]) -> type[Invoker]:
371369

372370
return inner_wrapper
373371

374-
375372
@classmethod
376373
def _get_name(
377374
cls,

runtime/prompty/tests/test_core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ def test_prompty_to_safe_dict(self, **kwargs):
2020
prompt_file = "prompts/chat.prompty"
2121
p = prompty.load(prompt_file)
2222
p.basePrompty = p_base
23-
p.inputs = {"key1": "value1", "key2": "value2"} # type: ignore
24-
p.outputs = {"key3": "value3", "key4": "value4"} # type: ignore
23+
p.inputs = {"key1": "value1", "key2": "value2"} # type: ignore
24+
p.outputs = {"key3": "value3", "key4": "value4"} # type: ignore
2525
p.file = "/path/to/file"
2626
d = p.to_safe_dict()
2727
assert d["name"] == "Basic Prompt"

0 commit comments

Comments
 (0)