forked from zauberzeug/nicegui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # DEPENDENCIES.md # npm.json
- Loading branch information
Showing
721 changed files
with
80,600 additions
and
82,805 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ jobs: | |
test: | ||
strategy: | ||
matrix: | ||
python: ["3.8", "3.9", "3.10", "3.11"] | ||
python: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
fail-fast: false | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 40 | ||
|
@@ -19,9 +19,10 @@ jobs: | |
- name: set up Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: "1.3.1" | ||
poetry-version: "1.6.1" | ||
- name: install dependencies | ||
run: | | ||
set -x | ||
poetry config virtualenvs.create false | ||
poetry install --all-extras | ||
# install packages to run the examples | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
__pycache__/ | ||
*.egg-info/ | ||
.*.swp | ||
dist | ||
/test.py | ||
*.pickle | ||
tests/screenshots/ | ||
tests/media/ | ||
venv | ||
.idea | ||
.nicegui/ | ||
*.sqlite* | ||
.DS_Store | ||
.pytest_cache/ | ||
.vscode/ | ||
.github/ | ||
tests/ | ||
.git/ | ||
.mypy_cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
# Included Web Dependencies | ||
|
||
- vue: 3.3.4 ([MIT](https://opensource.org/licenses/MIT)) | ||
- quasar: 2.12.2 ([MIT](https://opensource.org/licenses/MIT)) | ||
- tailwindcss: 3.3.2 ([MIT](https://opensource.org/licenses/MIT)) | ||
- socket.io: 4.7.1 ([MIT](https://opensource.org/licenses/MIT)) | ||
- es-module-shims: 1.7.3 ([MIT](https://opensource.org/licenses/MIT)) | ||
- aggrid: 30.0.3 ([MIT](https://opensource.org/licenses/MIT)) | ||
- vue: 3.3.6 ([MIT](https://opensource.org/licenses/MIT)) | ||
- quasar: 2.13.0 ([MIT](https://opensource.org/licenses/MIT)) | ||
- tailwindcss: 3.2.0 ([MIT](https://opensource.org/licenses/MIT)) | ||
- socket.io: 4.7.2 ([MIT](https://opensource.org/licenses/MIT)) | ||
- es-module-shims: 1.8.0 ([MIT](https://opensource.org/licenses/MIT)) | ||
- aggrid: 30.2.0 ([MIT](https://opensource.org/licenses/MIT)) | ||
- echarts: 5.4.3 ([Apache-2.0](https://opensource.org/licenses/Apache-2.0)) | ||
- highcharts: 11.1.0 ([https://www.highcharts.com/license](https://www.highcharts.com/license)) | ||
- leaflet: 1.9.4 ([BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause)) | ||
- mermaid: 10.2.4 ([MIT](https://opensource.org/licenses/MIT)) | ||
- mermaid: 10.5.1 ([MIT](https://opensource.org/licenses/MIT)) | ||
- nipplejs: 0.10.1 ([MIT](https://opensource.org/licenses/MIT)) | ||
- plotly: 2.24.3 ([MIT](https://opensource.org/licenses/MIT)) | ||
- three: 0.154.0 ([MIT](https://opensource.org/licenses/MIT)) | ||
- plotly: 2.27.0 ([MIT](https://opensource.org/licenses/MIT)) | ||
- three: 0.157.0 ([MIT](https://opensource.org/licenses/MIT)) | ||
- tween: 21.0.0 ([MIT](https://opensource.org/licenses/MIT)) | ||
- vanilla-jsoneditor: 0.18.0 ([ISC](https://opensource.org/licenses/ISC)) | ||
- vanilla-jsoneditor: 0.18.10 ([ISC](https://opensource.org/licenses/ISC)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from typing import Any, Dict, Optional | ||
|
||
from langchain.callbacks.base import BaseCallbackHandler | ||
from langchain.schema import AgentAction, AgentFinish | ||
|
||
from nicegui import ui | ||
|
||
|
||
class NiceGuiLogElementCallbackHandler(BaseCallbackHandler): | ||
"""Callback Handler that writes to a log element.""" | ||
|
||
def __init__(self, log_element: ui.log) -> None: | ||
"""Initialize callback handler.""" | ||
self.log = log_element | ||
|
||
def on_chain_start(self, serialized: Dict[str, Any], inputs: Dict[str, Any], **kwargs: Any) -> None: | ||
"""Print out that we are entering a chain.""" | ||
self.log.push(f'\n\n> Entering new {serialized["id"][-1]} chain...') | ||
|
||
def on_chain_end(self, outputs: Dict[str, Any], **kwargs: Any) -> None: | ||
"""Print out that we finished a chain.""" | ||
self.log.push('\n> Finished chain.') | ||
self.log.push(f'\nOutputs: {outputs}') | ||
|
||
def on_agent_action(self, action: AgentAction, **kwargs: Any) -> Any: | ||
"""Run on agent action.""" | ||
self.log.push(action.log) | ||
|
||
def on_tool_end(self, | ||
output: str, | ||
observation_prefix: Optional[str] = None, | ||
llm_prefix: Optional[str] = None, | ||
**kwargs: Any, | ||
) -> None: | ||
"""If not the final action, print out observation.""" | ||
if observation_prefix is not None: | ||
self.log.push(f'\n{observation_prefix}') | ||
self.log.push(output) | ||
if llm_prefix is not None: | ||
self.log.push(f'\n{llm_prefix}') | ||
|
||
def on_text(self, text: str, **kwargs: Any) -> None: | ||
"""Run when agent ends.""" | ||
self.log.push(text) | ||
|
||
def on_agent_finish(self, finish: AgentFinish, **kwargs: Any) -> None: | ||
"""Run on agent end.""" | ||
self.log.push(finish.log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.