Skip to content

Commit

Permalink
Fix history for sheets
Browse files Browse the repository at this point in the history
  • Loading branch information
vegito22 committed Oct 24, 2024
1 parent 567790e commit 16bb18b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions llmstack/apps/runner/app_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ def id(self):

class SheetStoreAppRunnerSource(StoreAppRunnerSource):
type: AppRunnerSourceType = AppRunnerSourceType.SHEET
request_ip: str = ""
request_location: str = ""
request_user_agent: str = "Promptly"
sheet_id: str

@property
Expand Down Expand Up @@ -397,17 +400,18 @@ async def run(self, request: AppRunnerRequest):

# Send the final output
if "chunks" in output:
# Persist bookkeeping data
bookkeeping_data = self._coordinator.bookkeeping_data().get().get()
self._source.effects(request_id, self._session_id, output, bookkeeping_data)

# Send the final output
yield AppRunnerStreamingResponse(
id=request_id,
client_request_id=request.client_request_id,
type=AppRunnerStreamingResponseType.OUTPUT,
data=AppRunnerResponseOutputData(output=output.get("output", {}), chunks=output.get("chunks", {})),
)

# Persist bookkeeping data
bookkeeping_data = self._coordinator.bookkeeping_data().get().get()
self._source.effects(request_id, self._session_id, output, bookkeeping_data)

def run_until_complete(self, request: AppRunnerRequest, event_loop):
for response in iter_over_async(self.run(request), event_loop):
if isinstance(response.data, AppRunnerResponseErrorsData) or isinstance(
Expand Down

0 comments on commit 16bb18b

Please sign in to comment.