Skip to content

Commit d9733e6

Browse files
committed
Bug fix
1 parent 66ae5ff commit d9733e6

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

jigsawstack/prompt_engine.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,26 @@ class PromptEngineResult(TypedDict):
1313

1414

1515
class PromptEngineRunParams(TypedDict):
16-
input_values: object
16+
prompt:str
17+
inputs: NotRequired[List[object]]
18+
return_prompt: Union[str, List[object], Dict[str, str]]
19+
grok_key: NotRequired[str]
20+
input_values: NotRequired[Dict[str, str]]
1721

22+
class PromptEngineExecuteParams(TypedDict):
23+
id:str
24+
input_values: object
1825

1926
class PromptEngineRunResponse(TypedDict):
2027
success: bool
21-
result:str
28+
result:Any
29+
2230

2331
class PromptEngineCreateParams(TypedDict):
2432
prompt: str
25-
26-
inputs: List[object]
27-
28-
return_prompt: str
33+
grok_key: NotRequired[str]
34+
inputs: NotRequired[List[object]]
35+
return_prompt: Union[str, List[object], Dict[str, str]]
2936

3037
class PromptEngineCreateResponse(TypedDict):
3138
success: bool
@@ -93,7 +100,16 @@ def delete(self, id:str) -> PromptEngineDeleteResponse:
93100
path=path,params={},verb="DELETE").perform_with_content()
94101
return resp
95102

96-
def run(self, id:str, params:PromptEngineRunParams) -> PromptEngineRunResponse:
103+
def run(self, params:PromptEngineRunParams) -> PromptEngineRunResponse:
104+
path = "/prompt_engine/run"
105+
resp = Request(
106+
api_key=self.api_key,
107+
api_url=self.api_url,
108+
path=path,params=cast(Dict[Any, Any], params),verb="post").perform_with_content()
109+
return resp
110+
111+
def execute(self, params:PromptEngineExecuteParams) -> PromptEngineRunResponse:
112+
id = params.get("id")
97113
path = f"/prompt_engine/{id}"
98114
resp = Request(
99115
api_key=self.api_key,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="jigsawstack",
9-
version="0.1.8",
9+
version="0.1.9",
1010
description="JigsawStack Python SDK",
1111
long_description=open("README.md", encoding="utf8").read(),
1212
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)