Skip to content

Commit 74d8aa6

Browse files
ntindleaarushik93
andauthored
Update llm.py (#8513)
* Update llm.py * Update llm.py * Update llm.py * Update llm.py --------- Co-authored-by: Aarushi <[email protected]>
1 parent 3ea50f3 commit 74d8aa6

File tree

1 file changed

+10
-4
lines changed
  • autogpt_platform/backend/backend/blocks

1 file changed

+10
-4
lines changed

autogpt_platform/backend/backend/blocks/llm.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -519,18 +519,24 @@ def __init__(self):
519519
test_mock={"llm_call": lambda *args, **kwargs: "Response text"},
520520
)
521521

522-
def llm_call(self, input_data: AIStructuredResponseGeneratorBlock.Input) -> str:
522+
def llm_call(
523+
self,
524+
input_data: AIStructuredResponseGeneratorBlock.Input,
525+
credentials: APIKeyCredentials,
526+
) -> str:
523527
block = AIStructuredResponseGeneratorBlock()
524-
response = block.run_once(input_data, "response")
528+
response = block.run_once(input_data, "response", credentials=credentials)
525529
self.merge_stats(block.execution_stats)
526530
return response["response"]
527531

528-
def run(self, input_data: Input, **kwargs) -> BlockOutput:
532+
def run(
533+
self, input_data: Input, *, credentials: APIKeyCredentials, **kwargs
534+
) -> BlockOutput:
529535
object_input_data = AIStructuredResponseGeneratorBlock.Input(
530536
**{attr: getattr(input_data, attr) for attr in input_data.model_fields},
531537
expected_format={},
532538
)
533-
yield "response", self.llm_call(object_input_data)
539+
yield "response", self.llm_call(object_input_data, credentials)
534540

535541

536542
class SummaryStyle(Enum):

0 commit comments

Comments
 (0)