agent-starter-pack 0.3.3__py3-none-any.whl → 0.21.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agent_starter_pack/agents/README.md +7 -0
- agents/langgraph_base_react/template/.templateconfig.yaml → agent_starter_pack/agents/adk_a2a_base/.template/templateconfig.yaml +5 -10
- agent_starter_pack/agents/adk_a2a_base/README.md +37 -0
- src/deployment_targets/cloud_run/Dockerfile → agent_starter_pack/agents/adk_a2a_base/app/__init__.py +2 -14
- agent_starter_pack/agents/adk_a2a_base/app/agent.py +70 -0
- agent_starter_pack/agents/adk_a2a_base/notebooks/adk_a2a_app_testing.ipynb +583 -0
- agents/crewai_coding_crew/notebooks/evaluating_crewai_agent.ipynb → agent_starter_pack/agents/adk_a2a_base/notebooks/evaluating_adk_agent.ipynb +163 -199
- {agents/adk_base → agent_starter_pack/agents/adk_a2a_base}/tests/integration/test_agent.py +2 -2
- agents/adk_base/template/.templateconfig.yaml → agent_starter_pack/agents/adk_base/.template/templateconfig.yaml +4 -1
- {agents → agent_starter_pack/agents}/adk_base/README.md +1 -1
- agent_starter_pack/agents/adk_base/app/__init__.py +17 -0
- {agents → agent_starter_pack/agents}/adk_base/app/agent.py +5 -2
- {agents → agent_starter_pack/agents}/adk_base/notebooks/adk_app_testing.ipynb +128 -82
- agents/langgraph_base_react/notebooks/evaluating_langgraph_agent.ipynb → agent_starter_pack/agents/adk_base/notebooks/evaluating_adk_agent.ipynb +181 -207
- agent_starter_pack/agents/adk_base/tests/integration/test_agent.py +58 -0
- agents/crewai_coding_crew/template/.templateconfig.yaml → agent_starter_pack/agents/adk_live/.template/templateconfig.yaml +5 -9
- agent_starter_pack/agents/adk_live/README.md +32 -0
- agent_starter_pack/agents/adk_live/app/__init__.py +17 -0
- agent_starter_pack/agents/adk_live/app/agent.py +51 -0
- agent_starter_pack/agents/adk_live/tests/unit/test_dummy.py +38 -0
- agents/agentic_rag/template/.templateconfig.yaml → agent_starter_pack/agents/agentic_rag/.template/templateconfig.yaml +7 -3
- {agents → agent_starter_pack/agents}/agentic_rag/README.md +1 -1
- agent_starter_pack/agents/agentic_rag/app/__init__.py +17 -0
- {agents → agent_starter_pack/agents}/agentic_rag/app/agent.py +8 -4
- {agents → agent_starter_pack/agents}/agentic_rag/notebooks/adk_app_testing.ipynb +128 -82
- agent_starter_pack/agents/agentic_rag/notebooks/evaluating_adk_agent.ipynb +1535 -0
- {agents → agent_starter_pack/agents}/agentic_rag/tests/integration/test_agent.py +3 -3
- agent_starter_pack/agents/langgraph_base/.template/templateconfig.yaml +31 -0
- agent_starter_pack/agents/langgraph_base/README.md +30 -0
- agent_starter_pack/agents/langgraph_base/app/__init__.py +17 -0
- agent_starter_pack/agents/langgraph_base/app/agent.py +34 -0
- {agents/crewai_coding_crew → agent_starter_pack/agents/langgraph_base}/notebooks/evaluating_langgraph_agent.ipynb +30 -17
- {agents/langgraph_base_react → agent_starter_pack/agents/langgraph_base}/tests/integration/test_agent.py +2 -2
- {src → agent_starter_pack}/base_template/.gitignore +5 -3
- agent_starter_pack/base_template/GEMINI.md +5 -0
- agent_starter_pack/base_template/Makefile +339 -0
- agent_starter_pack/base_template/README.md +267 -0
- agent_starter_pack/base_template/deployment/README.md +11 -0
- {src → agent_starter_pack}/base_template/deployment/terraform/apis.tf +2 -2
- {src → agent_starter_pack}/base_template/deployment/terraform/dev/apis.tf +6 -1
- {src → agent_starter_pack}/base_template/deployment/terraform/dev/iam.tf +12 -11
- {src → agent_starter_pack}/base_template/deployment/terraform/dev/providers.tf +5 -1
- {src → agent_starter_pack}/base_template/deployment/terraform/dev/storage.tf +1 -1
- {src → agent_starter_pack}/base_template/deployment/terraform/dev/variables.tf +10 -10
- agent_starter_pack/base_template/deployment/terraform/dev/{% if cookiecutter.is_adk %}telemetry.tf{% else %}unused_telemetry.tf{% endif %} +193 -0
- agent_starter_pack/base_template/deployment/terraform/github.tf +337 -0
- {src → agent_starter_pack}/base_template/deployment/terraform/iam.tf +20 -41
- {src → agent_starter_pack}/base_template/deployment/terraform/locals.tf +10 -3
- {src/resources/setup_cicd → agent_starter_pack/base_template/deployment/terraform}/providers.tf +8 -1
- {src → agent_starter_pack}/base_template/deployment/terraform/service_accounts.tf +7 -8
- agent_starter_pack/base_template/deployment/terraform/sql/completions.sql +138 -0
- {src → agent_starter_pack}/base_template/deployment/terraform/storage.tf +7 -16
- {src → agent_starter_pack}/base_template/deployment/terraform/variables.tf +61 -28
- {src → agent_starter_pack}/base_template/deployment/terraform/vars/env.tfvars +6 -1
- agent_starter_pack/base_template/deployment/terraform/{% if cookiecutter.cicd_runner == 'github_actions' %}wif.tf{% else %}unused_wif.tf{% endif %} +43 -0
- src/base_template/deployment/terraform/build_triggers.tf → agent_starter_pack/base_template/deployment/terraform/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}build_triggers.tf{% else %}unused_build_triggers.tf{% endif %} +55 -38
- agent_starter_pack/base_template/deployment/terraform/{% if cookiecutter.is_adk %}telemetry.tf{% else %}unused_telemetry.tf{% endif %} +206 -0
- {src → agent_starter_pack}/base_template/pyproject.toml +24 -37
- agent_starter_pack/base_template/{% if cookiecutter.cicd_runner == 'github_actions' %}.github{% else %}unused_github{% endif %}/workflows/deploy-to-prod.yaml +132 -0
- agent_starter_pack/base_template/{% if cookiecutter.cicd_runner == 'github_actions' %}.github{% else %}unused_github{% endif %}/workflows/pr_checks.yaml +65 -0
- agent_starter_pack/base_template/{% if cookiecutter.cicd_runner == 'github_actions' %}.github{% else %}unused_github{% endif %}/workflows/staging.yaml +259 -0
- src/base_template/deployment/cd/deploy-to-prod.yaml → agent_starter_pack/base_template/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}.cloudbuild{% else %}unused_.cloudbuild{% endif %}/deploy-to-prod.yaml +38 -30
- src/base_template/deployment/ci/pr_checks.yaml → agent_starter_pack/base_template/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}.cloudbuild{% else %}unused_.cloudbuild{% endif %}/pr_checks.yaml +5 -5
- agent_starter_pack/base_template/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}.cloudbuild{% else %}unused_.cloudbuild{% endif %}/staging.yaml +322 -0
- agent_starter_pack/base_template/{{cookiecutter.agent_directory}}/app_utils/telemetry.py +96 -0
- {src/base_template/app/utils → agent_starter_pack/base_template/{{cookiecutter.agent_directory}}/app_utils}/typing.py +7 -9
- agent_starter_pack/base_template/{{cookiecutter.agent_directory}}/app_utils/{% if cookiecutter.is_a2a and cookiecutter.agent_name == 'langgraph_base' %}converters{% else %}unused_converters{% endif %}/__init__.py +25 -0
- agent_starter_pack/base_template/{{cookiecutter.agent_directory}}/app_utils/{% if cookiecutter.is_a2a and cookiecutter.agent_name == 'langgraph_base' %}converters{% else %}unused_converters{% endif %}/part_converter.py +138 -0
- agent_starter_pack/base_template/{{cookiecutter.agent_directory}}/app_utils/{% if cookiecutter.is_a2a and cookiecutter.agent_name == 'langgraph_base' %}executor{% else %}unused_executor{% endif %}/__init__.py +13 -0
- agent_starter_pack/base_template/{{cookiecutter.agent_directory}}/app_utils/{% if cookiecutter.is_a2a and cookiecutter.agent_name == 'langgraph_base' %}executor{% else %}unused_executor{% endif %}/a2a_agent_executor.py +265 -0
- agent_starter_pack/base_template/{{cookiecutter.agent_directory}}/app_utils/{% if cookiecutter.is_a2a and cookiecutter.agent_name == 'langgraph_base' %}executor{% else %}unused_executor{% endif %}/task_result_aggregator.py +152 -0
- agent_starter_pack/cli/commands/create.py +1256 -0
- agent_starter_pack/cli/commands/enhance.py +611 -0
- agent_starter_pack/cli/commands/list.py +203 -0
- agent_starter_pack/cli/commands/register_gemini_enterprise.py +1070 -0
- agent_starter_pack/cli/commands/setup_cicd.py +862 -0
- {src → agent_starter_pack}/cli/main.py +10 -2
- {src → agent_starter_pack}/cli/utils/cicd.py +139 -48
- agent_starter_pack/cli/utils/gcp.py +263 -0
- agent_starter_pack/cli/utils/logging.py +103 -0
- agent_starter_pack/cli/utils/remote_template.py +677 -0
- agent_starter_pack/cli/utils/template.py +1466 -0
- {src → agent_starter_pack}/data_ingestion/data_ingestion_pipeline/components/process_data.py +1 -1
- {src → agent_starter_pack}/data_ingestion/data_ingestion_pipeline/submit_pipeline.py +20 -6
- {src → agent_starter_pack}/data_ingestion/pyproject.toml +1 -0
- {src → agent_starter_pack}/data_ingestion/uv.lock +602 -494
- agent_starter_pack/deployment_targets/agent_engine/tests/integration/test_agent_engine_app.py +484 -0
- agent_starter_pack/deployment_targets/agent_engine/tests/load_test/README.md +84 -0
- agent_starter_pack/deployment_targets/agent_engine/tests/load_test/load_test.py +424 -0
- agent_starter_pack/deployment_targets/agent_engine/tests/{% if cookiecutter.is_a2a %}helpers.py{% else %}unused_helpers.py{% endif %} +138 -0
- agent_starter_pack/deployment_targets/agent_engine/{{cookiecutter.agent_directory}}/agent_engine_app.py +263 -0
- agent_starter_pack/deployment_targets/agent_engine/{{cookiecutter.agent_directory}}/app_utils/deploy.py +414 -0
- agent_starter_pack/deployment_targets/agent_engine/{{cookiecutter.agent_directory}}/app_utils/{% if cookiecutter.is_adk_live %}expose_app.py{% else %}unused_expose_app.py{% endif %} +519 -0
- agent_starter_pack/deployment_targets/cloud_run/Dockerfile +51 -0
- agent_starter_pack/deployment_targets/cloud_run/deployment/terraform/dev/service.tf +243 -0
- agent_starter_pack/deployment_targets/cloud_run/deployment/terraform/service.tf +417 -0
- agent_starter_pack/deployment_targets/cloud_run/tests/integration/test_server_e2e.py +705 -0
- agent_starter_pack/deployment_targets/cloud_run/tests/load_test/.results/.placeholder +321 -0
- agent_starter_pack/deployment_targets/cloud_run/tests/load_test/README.md +165 -0
- agent_starter_pack/deployment_targets/cloud_run/tests/load_test/load_test.py +329 -0
- agent_starter_pack/deployment_targets/cloud_run/{{cookiecutter.agent_directory}}/fast_api_app.py +556 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/package-lock.json +79 -1044
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/package.json +1 -9
- agent_starter_pack/frontends/adk_live_react/frontend/src/App.tsx +65 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/components/logger/Logger.tsx +8 -3
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/components/logger/logger.scss +26 -0
- agent_starter_pack/frontends/adk_live_react/frontend/src/components/side-panel/SidePanel.tsx +516 -0
- agent_starter_pack/frontends/adk_live_react/frontend/src/components/side-panel/side-panel.scss +563 -0
- agent_starter_pack/frontends/adk_live_react/frontend/src/components/transcription-preview/TranscriptionPreview.tsx +106 -0
- agent_starter_pack/frontends/adk_live_react/frontend/src/components/transcription-preview/transcription-preview.scss +150 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/hooks/use-live-api.ts +8 -2
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/multimodal-live-types.ts +40 -2
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/audio-recorder.ts +1 -1
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/audio-streamer.ts +1 -1
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/multimodal-live-client.ts +210 -24
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/utils.ts +27 -5
- agent_starter_pack/resources/docs/adk-cheatsheet.md +1628 -0
- agent_starter_pack/resources/locks/uv-adk_a2a_base-agent_engine.lock +4966 -0
- agent_starter_pack/resources/locks/uv-adk_a2a_base-cloud_run.lock +5011 -0
- agent_starter_pack/resources/locks/uv-adk_base-agent_engine.lock +4946 -0
- agent_starter_pack/resources/locks/uv-adk_base-cloud_run.lock +4991 -0
- agent_starter_pack/resources/locks/uv-adk_live-agent_engine.lock +4963 -0
- agent_starter_pack/resources/locks/uv-adk_live-cloud_run.lock +5006 -0
- agent_starter_pack/resources/locks/uv-agentic_rag-agent_engine.lock +5487 -0
- agent_starter_pack/resources/locks/uv-agentic_rag-cloud_run.lock +5532 -0
- agent_starter_pack/resources/locks/uv-langgraph_base-agent_engine.lock +5788 -0
- agent_starter_pack/resources/locks/uv-langgraph_base-cloud_run.lock +5811 -0
- {src → agent_starter_pack}/utils/generate_locks.py +15 -12
- {src → agent_starter_pack}/utils/lock_utils.py +4 -7
- {src → agent_starter_pack}/utils/watch_and_rebuild.py +2 -2
- agent_starter_pack-0.21.0.dist-info/METADATA +182 -0
- agent_starter_pack-0.21.0.dist-info/RECORD +171 -0
- agent_starter_pack-0.21.0.dist-info/entry_points.txt +2 -0
- llm.txt +362 -0
- agent_starter_pack-0.3.3.dist-info/METADATA +0 -164
- agent_starter_pack-0.3.3.dist-info/RECORD +0 -176
- agent_starter_pack-0.3.3.dist-info/entry_points.txt +0 -2
- agents/crewai_coding_crew/README.md +0 -34
- agents/crewai_coding_crew/app/agent.py +0 -86
- agents/crewai_coding_crew/app/crew/config/agents.yaml +0 -39
- agents/crewai_coding_crew/app/crew/config/tasks.yaml +0 -37
- agents/crewai_coding_crew/app/crew/crew.py +0 -71
- agents/crewai_coding_crew/tests/integration/test_agent.py +0 -47
- agents/langgraph_base_react/README.md +0 -9
- agents/langgraph_base_react/app/agent.py +0 -73
- agents/live_api/README.md +0 -37
- agents/live_api/app/agent.py +0 -78
- agents/live_api/app/server.py +0 -196
- agents/live_api/app/templates.py +0 -51
- agents/live_api/app/vector_store.py +0 -55
- agents/live_api/template/.templateconfig.yaml +0 -29
- agents/live_api/tests/integration/test_server_e2e.py +0 -254
- agents/live_api/tests/load_test/load_test.py +0 -40
- agents/live_api/tests/unit/test_server.py +0 -143
- src/base_template/Makefile +0 -72
- src/base_template/README.md +0 -208
- src/base_template/app/__init__.py +0 -3
- src/base_template/app/utils/tracing.py +0 -155
- src/base_template/deployment/README.md +0 -126
- src/base_template/deployment/cd/staging.yaml +0 -216
- src/base_template/deployment/terraform/dev/log_sinks.tf +0 -63
- src/base_template/deployment/terraform/log_sinks.tf +0 -70
- src/base_template/deployment/terraform/providers.tf +0 -37
- src/cli/commands/create.py +0 -664
- src/cli/commands/setup_cicd.py +0 -829
- src/cli/utils/gcp.py +0 -117
- src/cli/utils/logging.py +0 -51
- src/cli/utils/template.py +0 -737
- src/deployment_targets/agent_engine/app/agent_engine_app.py +0 -336
- src/deployment_targets/agent_engine/notebooks/intro_agent_engine.ipynb +0 -1025
- src/deployment_targets/agent_engine/tests/integration/test_agent_engine_app.py +0 -183
- src/deployment_targets/agent_engine/tests/load_test/README.md +0 -42
- src/deployment_targets/agent_engine/tests/load_test/load_test.py +0 -107
- src/deployment_targets/cloud_run/app/server.py +0 -154
- src/deployment_targets/cloud_run/tests/integration/test_server_e2e.py +0 -249
- src/deployment_targets/cloud_run/tests/load_test/.results/.placeholder +0 -0
- src/deployment_targets/cloud_run/tests/load_test/README.md +0 -83
- src/deployment_targets/cloud_run/tests/load_test/load_test.py +0 -118
- src/deployment_targets/cloud_run/uv.lock +0 -6952
- src/frontends/live_api_react/frontend/src/App.tsx +0 -205
- src/frontends/live_api_react/frontend/src/components/control-tray/ControlTray.tsx +0 -217
- src/frontends/live_api_react/frontend/src/components/control-tray/control-tray.scss +0 -201
- src/frontends/live_api_react/frontend/src/components/side-panel/SidePanel.tsx +0 -161
- src/frontends/live_api_react/frontend/src/components/side-panel/side-panel.scss +0 -285
- src/frontends/streamlit/frontend/side_bar.py +0 -214
- src/frontends/streamlit/frontend/streamlit_app.py +0 -265
- src/frontends/streamlit/frontend/style/app_markdown.py +0 -37
- src/frontends/streamlit/frontend/utils/chat_utils.py +0 -67
- src/frontends/streamlit/frontend/utils/local_chat_history.py +0 -125
- src/frontends/streamlit/frontend/utils/message_editing.py +0 -59
- src/frontends/streamlit/frontend/utils/multimodal_utils.py +0 -217
- src/frontends/streamlit/frontend/utils/stream_handler.py +0 -301
- src/frontends/streamlit/frontend/utils/title_summary.py +0 -94
- src/frontends/streamlit_adk/frontend/side_bar.py +0 -214
- src/frontends/streamlit_adk/frontend/streamlit_app.py +0 -314
- src/frontends/streamlit_adk/frontend/style/app_markdown.py +0 -37
- src/frontends/streamlit_adk/frontend/utils/chat_utils.py +0 -84
- src/frontends/streamlit_adk/frontend/utils/local_chat_history.py +0 -110
- src/frontends/streamlit_adk/frontend/utils/message_editing.py +0 -61
- src/frontends/streamlit_adk/frontend/utils/multimodal_utils.py +0 -223
- src/frontends/streamlit_adk/frontend/utils/stream_handler.py +0 -311
- src/frontends/streamlit_adk/frontend/utils/title_summary.py +0 -129
- src/resources/containers/data_processing/Dockerfile +0 -27
- src/resources/containers/e2e-tests/Dockerfile +0 -19
- src/resources/idx/.idx/dev.nix +0 -57
- src/resources/idx/idx-template.json +0 -21
- src/resources/idx/idx-template.nix +0 -26
- src/resources/locks/uv-adk_base-agent_engine.lock +0 -5338
- src/resources/locks/uv-adk_base-cloud_run.lock +0 -5930
- src/resources/locks/uv-agentic_rag-agent_engine.lock +0 -5528
- src/resources/locks/uv-agentic_rag-cloud_run.lock +0 -6120
- src/resources/locks/uv-crewai_coding_crew-agent_engine.lock +0 -6231
- src/resources/locks/uv-crewai_coding_crew-cloud_run.lock +0 -6839
- src/resources/locks/uv-langgraph_base_react-agent_engine.lock +0 -5233
- src/resources/locks/uv-langgraph_base_react-cloud_run.lock +0 -5862
- src/resources/locks/uv-live_api-cloud_run.lock +0 -5832
- src/resources/setup_cicd/cicd_variables.tf +0 -41
- src/resources/setup_cicd/github.tf +0 -87
- {agents → agent_starter_pack/agents}/agentic_rag/app/retrievers.py +0 -0
- {agents → agent_starter_pack/agents}/agentic_rag/app/templates.py +0 -0
- {src → agent_starter_pack}/base_template/deployment/terraform/dev/vars/env.tfvars +0 -0
- {src → agent_starter_pack}/base_template/tests/unit/test_dummy.py +0 -0
- {src/deployment_targets/agent_engine/app/utils → agent_starter_pack/base_template/{{cookiecutter.agent_directory}}/app_utils}/gcs.py +0 -0
- {src → agent_starter_pack}/cli/utils/__init__.py +0 -0
- {src → agent_starter_pack}/cli/utils/datastores.py +0 -0
- {src → agent_starter_pack}/cli/utils/version.py +0 -0
- {src → agent_starter_pack}/data_ingestion/README.md +0 -0
- {src → agent_starter_pack}/data_ingestion/data_ingestion_pipeline/components/ingest_data.py +0 -0
- {src → agent_starter_pack}/data_ingestion/data_ingestion_pipeline/pipeline.py +0 -0
- {src → agent_starter_pack}/deployment_targets/agent_engine/deployment_metadata.json +0 -0
- {src → agent_starter_pack}/deployment_targets/agent_engine/tests/load_test/.results/.placeholder +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/public/favicon.ico +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/public/index.html +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/public/robots.txt +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/App.scss +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/App.test.tsx +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/components/audio-pulse/AudioPulse.tsx +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/components/audio-pulse/audio-pulse.scss +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/components/logger/mock-logs.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/contexts/LiveAPIContext.tsx +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/hooks/use-media-stream-mux.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/hooks/use-screen-capture.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/hooks/use-webcam.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/index.css +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/index.tsx +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/react-app-env.d.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/reportWebVitals.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/setupTests.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/audioworklet-registry.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/store-logger.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/worklets/audio-processing.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/worklets/vol-meter.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/tsconfig.json +0 -0
- {agent_starter_pack-0.3.3.dist-info → agent_starter_pack-0.21.0.dist-info}/WHEEL +0 -0
- {agent_starter_pack-0.3.3.dist-info → agent_starter_pack-0.21.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2024 Google LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import cn from "classnames";
|
|
18
|
-
import { useEffect, useRef, useState } from "react";
|
|
19
|
-
import { RiSidebarFoldLine, RiSidebarUnfoldLine } from "react-icons/ri";
|
|
20
|
-
import Select from "react-select";
|
|
21
|
-
import { useLiveAPIContext } from "../../contexts/LiveAPIContext";
|
|
22
|
-
import { useLoggerStore } from "../../utils/store-logger";
|
|
23
|
-
import Logger, { LoggerFilterType } from "../logger/Logger";
|
|
24
|
-
import "./side-panel.scss";
|
|
25
|
-
|
|
26
|
-
const filterOptions = [
|
|
27
|
-
{ value: "conversations", label: "Conversations" },
|
|
28
|
-
{ value: "tools", label: "Tool Use" },
|
|
29
|
-
{ value: "none", label: "All" },
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
export default function SidePanel() {
|
|
33
|
-
const { connected, client } = useLiveAPIContext();
|
|
34
|
-
const [open, setOpen] = useState(true);
|
|
35
|
-
const loggerRef = useRef<HTMLDivElement>(null);
|
|
36
|
-
const loggerLastHeightRef = useRef<number>(-1);
|
|
37
|
-
const { log, logs } = useLoggerStore();
|
|
38
|
-
|
|
39
|
-
const [textInput, setTextInput] = useState("");
|
|
40
|
-
const [selectedOption, setSelectedOption] = useState<{
|
|
41
|
-
value: string;
|
|
42
|
-
label: string;
|
|
43
|
-
} | null>(null);
|
|
44
|
-
const inputRef = useRef<HTMLTextAreaElement>(null);
|
|
45
|
-
|
|
46
|
-
//scroll the log to the bottom when new logs come in
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
if (loggerRef.current) {
|
|
49
|
-
const el = loggerRef.current;
|
|
50
|
-
const scrollHeight = el.scrollHeight;
|
|
51
|
-
if (scrollHeight !== loggerLastHeightRef.current) {
|
|
52
|
-
el.scrollTop = scrollHeight;
|
|
53
|
-
loggerLastHeightRef.current = scrollHeight;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}, [logs]);
|
|
57
|
-
|
|
58
|
-
// listen for log events and store them
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
client.on("log", log);
|
|
61
|
-
return () => {
|
|
62
|
-
client.off("log", log);
|
|
63
|
-
};
|
|
64
|
-
}, [client, log]);
|
|
65
|
-
|
|
66
|
-
const handleSubmit = () => {
|
|
67
|
-
client.send([{ text: textInput }]);
|
|
68
|
-
|
|
69
|
-
setTextInput("");
|
|
70
|
-
if (inputRef.current) {
|
|
71
|
-
inputRef.current.innerText = "";
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return (
|
|
76
|
-
<div className={`side-panel ${open ? "open" : ""}`}>
|
|
77
|
-
<header className="top">
|
|
78
|
-
<h2>Console</h2>
|
|
79
|
-
{open ? (
|
|
80
|
-
<button className="opener" onClick={() => setOpen(false)}>
|
|
81
|
-
<RiSidebarFoldLine color="#b4b8bb" />
|
|
82
|
-
</button>
|
|
83
|
-
) : (
|
|
84
|
-
<button className="opener" onClick={() => setOpen(true)}>
|
|
85
|
-
<RiSidebarUnfoldLine color="#b4b8bb" />
|
|
86
|
-
</button>
|
|
87
|
-
)}
|
|
88
|
-
</header>
|
|
89
|
-
<section className="indicators">
|
|
90
|
-
<Select
|
|
91
|
-
className="react-select"
|
|
92
|
-
classNamePrefix="react-select"
|
|
93
|
-
styles={{
|
|
94
|
-
control: (baseStyles) => ({
|
|
95
|
-
...baseStyles,
|
|
96
|
-
background: "var(--Neutral-15)",
|
|
97
|
-
color: "var(--Neutral-90)",
|
|
98
|
-
minHeight: "33px",
|
|
99
|
-
maxHeight: "33px",
|
|
100
|
-
border: 0,
|
|
101
|
-
}),
|
|
102
|
-
option: (styles, { isFocused, isSelected }) => ({
|
|
103
|
-
...styles,
|
|
104
|
-
backgroundColor: isFocused
|
|
105
|
-
? "var(--Neutral-30)"
|
|
106
|
-
: isSelected
|
|
107
|
-
? "var(--Neutral-20)"
|
|
108
|
-
: undefined,
|
|
109
|
-
}),
|
|
110
|
-
}}
|
|
111
|
-
defaultValue={selectedOption}
|
|
112
|
-
options={filterOptions}
|
|
113
|
-
onChange={(e) => {
|
|
114
|
-
setSelectedOption(e);
|
|
115
|
-
}}
|
|
116
|
-
/>
|
|
117
|
-
<div className={cn("streaming-indicator", { connected })}>
|
|
118
|
-
{connected
|
|
119
|
-
? `🔵${open ? " Streaming" : ""}`
|
|
120
|
-
: `⏸️${open ? " Paused" : ""}`}
|
|
121
|
-
</div>
|
|
122
|
-
</section>
|
|
123
|
-
<div className="side-panel-container" ref={loggerRef}>
|
|
124
|
-
<Logger
|
|
125
|
-
filter={(selectedOption?.value as LoggerFilterType) || "none"}
|
|
126
|
-
/>
|
|
127
|
-
</div>
|
|
128
|
-
<div className={cn("input-container", { disabled: !connected })}>
|
|
129
|
-
<div className="input-content">
|
|
130
|
-
<textarea
|
|
131
|
-
className="input-area"
|
|
132
|
-
ref={inputRef}
|
|
133
|
-
onKeyDown={(e) => {
|
|
134
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
135
|
-
e.preventDefault();
|
|
136
|
-
e.stopPropagation();
|
|
137
|
-
handleSubmit();
|
|
138
|
-
}
|
|
139
|
-
}}
|
|
140
|
-
onChange={(e) => setTextInput(e.target.value)}
|
|
141
|
-
value={textInput}
|
|
142
|
-
></textarea>
|
|
143
|
-
<span
|
|
144
|
-
className={cn("input-content-placeholder", {
|
|
145
|
-
hidden: textInput.length,
|
|
146
|
-
})}
|
|
147
|
-
>
|
|
148
|
-
Type something...
|
|
149
|
-
</span>
|
|
150
|
-
|
|
151
|
-
<button
|
|
152
|
-
className="send-button material-symbols-outlined filled"
|
|
153
|
-
onClick={handleSubmit}
|
|
154
|
-
>
|
|
155
|
-
send
|
|
156
|
-
</button>
|
|
157
|
-
</div>
|
|
158
|
-
</div>
|
|
159
|
-
</div>
|
|
160
|
-
);
|
|
161
|
-
}
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 Google LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/* stylelint-disable */
|
|
18
|
-
.side-panel {
|
|
19
|
-
.react-select {
|
|
20
|
-
background: var(--Neutral-20);
|
|
21
|
-
color: var(--Neutral-90);
|
|
22
|
-
width: 193px;
|
|
23
|
-
height: 30px;
|
|
24
|
-
|
|
25
|
-
.react-select__single-value {
|
|
26
|
-
color: var(--Neutral-90);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.react-select__menu {
|
|
30
|
-
background: var(--Neutral-20);
|
|
31
|
-
color: var(--Neutral-90);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.react-select__option {
|
|
35
|
-
}
|
|
36
|
-
.react-select__value-container {
|
|
37
|
-
}
|
|
38
|
-
.react-select__indicators {
|
|
39
|
-
}
|
|
40
|
-
.react-select__option:hover,
|
|
41
|
-
.react-select__option:focus,
|
|
42
|
-
.react-select_option:focus-within {
|
|
43
|
-
background: var(--Neutral-30);
|
|
44
|
-
}
|
|
45
|
-
.react-select__option--is-focused: {
|
|
46
|
-
background: var(--Neutral-30);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
background: var(--Neutral-00);
|
|
50
|
-
width: 40px; /* when closed */
|
|
51
|
-
display: flex;
|
|
52
|
-
flex-direction: column;
|
|
53
|
-
height: 100vh;
|
|
54
|
-
transition: all 0.2s ease-in;
|
|
55
|
-
font-family: Arial, sans-serif;
|
|
56
|
-
border-right: 1px solid var(--gray-600);
|
|
57
|
-
color: var(--Neutral-90, #e1e2e3);
|
|
58
|
-
font-family: var(--font-family);
|
|
59
|
-
font-size: 13px;
|
|
60
|
-
font-style: normal;
|
|
61
|
-
font-weight: 400;
|
|
62
|
-
line-height: 160%; /* 20.8px */
|
|
63
|
-
|
|
64
|
-
.hidden {
|
|
65
|
-
display: none !important;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
&.open {
|
|
69
|
-
.top {
|
|
70
|
-
h2 {
|
|
71
|
-
left: 0%;
|
|
72
|
-
display: block;
|
|
73
|
-
opacity: 1;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.top {
|
|
79
|
-
display: flex;
|
|
80
|
-
width: calc(100% - 45px);
|
|
81
|
-
justify-content: space-between;
|
|
82
|
-
align-items: center;
|
|
83
|
-
padding: 12px 20px 12px 25px;
|
|
84
|
-
border-bottom: 1px solid var(--Neutral-20);
|
|
85
|
-
|
|
86
|
-
h2 {
|
|
87
|
-
position: relative;
|
|
88
|
-
color: var(--Neutral-90, #e1e2e3);
|
|
89
|
-
font-family: "Google Sans";
|
|
90
|
-
font-size: 21px;
|
|
91
|
-
font-style: normal;
|
|
92
|
-
font-weight: 500;
|
|
93
|
-
line-height: 16px; /* 100% */
|
|
94
|
-
|
|
95
|
-
opacity: 0;
|
|
96
|
-
display: none;
|
|
97
|
-
left: -100%;
|
|
98
|
-
transition:
|
|
99
|
-
opacity 0.2s ease-in,
|
|
100
|
-
left 0.2s ease-in,
|
|
101
|
-
display 0.2s ease-in;
|
|
102
|
-
transition-behavior: allow-discrete;
|
|
103
|
-
|
|
104
|
-
@starting-style {
|
|
105
|
-
left: 0%;
|
|
106
|
-
opacity: 1;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.opener {
|
|
112
|
-
height: 30px;
|
|
113
|
-
transition: transform 0.2s ease-in;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
&:not(.open) {
|
|
117
|
-
.side-panel-container {
|
|
118
|
-
opacity: 0;
|
|
119
|
-
display: none;
|
|
120
|
-
transition: all 0.2s ease-in allow-discrete;
|
|
121
|
-
transition-delay: 0.1s;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.indicators .streaming-indicator {
|
|
125
|
-
width: 30px;
|
|
126
|
-
opacity: 0;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.opener {
|
|
130
|
-
transform: translate(-50%, 0);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.input-container {
|
|
134
|
-
opacity: 0;
|
|
135
|
-
display: none;
|
|
136
|
-
transition: all 0.2s ease-in allow-discrete;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.indicators {
|
|
141
|
-
display: flex;
|
|
142
|
-
padding: 24px 25px;
|
|
143
|
-
justify-content: flex-end;
|
|
144
|
-
gap: 21px;
|
|
145
|
-
.streaming-indicator {
|
|
146
|
-
user-select: none;
|
|
147
|
-
border-radius: 4px;
|
|
148
|
-
border: 1px solid var(--Neutral-20, #2a2f31);
|
|
149
|
-
background: var(--Neutral-10, #1c1f21);
|
|
150
|
-
display: flex;
|
|
151
|
-
width: 136px;
|
|
152
|
-
height: 30px;
|
|
153
|
-
padding-left: 4px;
|
|
154
|
-
justify-content: center;
|
|
155
|
-
align-items: center;
|
|
156
|
-
gap: 6px;
|
|
157
|
-
flex-shrink: 0;
|
|
158
|
-
text-align: center;
|
|
159
|
-
font-family: "Space Mono";
|
|
160
|
-
font-size: 14px;
|
|
161
|
-
font-style: normal;
|
|
162
|
-
font-weight: 400;
|
|
163
|
-
line-height: normal;
|
|
164
|
-
transition: width 0.2s ease-in;
|
|
165
|
-
|
|
166
|
-
&.connected {
|
|
167
|
-
color: var(--Blue-500, #0d9c53);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.side-panel-container {
|
|
173
|
-
align-self: flex-end;
|
|
174
|
-
width: 400px;
|
|
175
|
-
flex-grow: 1;
|
|
176
|
-
overflow-x: hidden;
|
|
177
|
-
overflow-y: auto;
|
|
178
|
-
/*scrollbar-gutter: stable both-edges;*/
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.input-container {
|
|
182
|
-
height: 50px;
|
|
183
|
-
flex-grow: 0;
|
|
184
|
-
flex-shrink: 0;
|
|
185
|
-
border-top: 1px solid var(--Neutral-20);
|
|
186
|
-
padding: 14px 25px;
|
|
187
|
-
overflow: hidden;
|
|
188
|
-
|
|
189
|
-
.input-content {
|
|
190
|
-
position: relative;
|
|
191
|
-
background: var(--Neutral-10);
|
|
192
|
-
border: 1px solid var(--Neutral-15);
|
|
193
|
-
height: 22px;
|
|
194
|
-
border-radius: 10px;
|
|
195
|
-
padding: 11px 18px;
|
|
196
|
-
|
|
197
|
-
.send-button {
|
|
198
|
-
position: absolute;
|
|
199
|
-
top: 50%;
|
|
200
|
-
right: 0;
|
|
201
|
-
transform: translate(0, -50%);
|
|
202
|
-
background: none;
|
|
203
|
-
border: 0;
|
|
204
|
-
color: var(--Neutral-20);
|
|
205
|
-
cursor: pointer;
|
|
206
|
-
transition: color 0.1s ease-in;
|
|
207
|
-
z-index: 2;
|
|
208
|
-
|
|
209
|
-
&:hover {
|
|
210
|
-
color: var(--Neutral-60);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.input-area {
|
|
215
|
-
background: none;
|
|
216
|
-
color: var(--Neutral-90);
|
|
217
|
-
field-sizing: content;
|
|
218
|
-
position: absolute;
|
|
219
|
-
top: 0;
|
|
220
|
-
left: 0;
|
|
221
|
-
z-index: 2;
|
|
222
|
-
display: inline-block;
|
|
223
|
-
width: calc(100% - 72px);
|
|
224
|
-
max-height: 20px;
|
|
225
|
-
outline: none;
|
|
226
|
-
--webkit-box-flex: 1;
|
|
227
|
-
flex: 1;
|
|
228
|
-
word-break: break-word;
|
|
229
|
-
overflow: auto;
|
|
230
|
-
padding: 14px 18px;
|
|
231
|
-
border: 0;
|
|
232
|
-
resize: none;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.input-content-placeholder {
|
|
236
|
-
position: absolute;
|
|
237
|
-
left: 0;
|
|
238
|
-
top: 0;
|
|
239
|
-
display: flex;
|
|
240
|
-
align-items: center;
|
|
241
|
-
z-index: 1;
|
|
242
|
-
height: 100%;
|
|
243
|
-
width: 100%;
|
|
244
|
-
pointer-events: none;
|
|
245
|
-
user-select: none;
|
|
246
|
-
padding: 0px 18px;
|
|
247
|
-
white-space: pre-wrap;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
.side-panel.open {
|
|
253
|
-
width: 400px;
|
|
254
|
-
height: 100vh;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.side-panel-responses,
|
|
258
|
-
.side-panel-requests {
|
|
259
|
-
flex-grow: 1;
|
|
260
|
-
flex-shrink: 1;
|
|
261
|
-
overflow-x: hidden;
|
|
262
|
-
overflow-y: auto;
|
|
263
|
-
width: 100%;
|
|
264
|
-
display: block;
|
|
265
|
-
margin-left: 8px;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.top {
|
|
269
|
-
width: 100%;
|
|
270
|
-
flex-grow: 0;
|
|
271
|
-
flex-shrink: 0;
|
|
272
|
-
height: 30px;
|
|
273
|
-
display: flex;
|
|
274
|
-
align-self: flex-end;
|
|
275
|
-
align-items: center;
|
|
276
|
-
transition: all 0.2s ease-in;
|
|
277
|
-
}
|
|
278
|
-
.top button {
|
|
279
|
-
background: transparent;
|
|
280
|
-
border: 0;
|
|
281
|
-
cursor: pointer;
|
|
282
|
-
font-size: 1.25rem;
|
|
283
|
-
line-height: 1.75rem;
|
|
284
|
-
padding: 4px;
|
|
285
|
-
}
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
# Copyright 2025 Google LLC
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
# ruff: noqa: RUF015
|
|
16
|
-
import json
|
|
17
|
-
import os
|
|
18
|
-
import uuid
|
|
19
|
-
from typing import Any
|
|
20
|
-
|
|
21
|
-
from frontend.utils.chat_utils import save_chat
|
|
22
|
-
from frontend.utils.multimodal_utils import (
|
|
23
|
-
HELP_GCS_CHECKBOX,
|
|
24
|
-
HELP_MESSAGE_MULTIMODALITY,
|
|
25
|
-
upload_files_to_gcs,
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
EMPTY_CHAT_NAME = "Empty chat"
|
|
29
|
-
NUM_CHAT_IN_RECENT = 3
|
|
30
|
-
DEFAULT_BASE_URL = "http://localhost:8000/"
|
|
31
|
-
|
|
32
|
-
DEFAULT_REMOTE_AGENT_ENGINE_ID = "N/A"
|
|
33
|
-
if os.path.exists("deployment_metadata.json"):
|
|
34
|
-
with open("deployment_metadata.json") as f:
|
|
35
|
-
DEFAULT_REMOTE_AGENT_ENGINE_ID = json.load(f)["remote_agent_engine_id"]
|
|
36
|
-
DEFAULT_AGENT_CALLABLE_PATH = "app.agent_engine_app.AgentEngineApp"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
class SideBar:
|
|
40
|
-
"""Manages the sidebar components of the Streamlit application."""
|
|
41
|
-
|
|
42
|
-
def __init__(self, st: Any) -> None:
|
|
43
|
-
"""
|
|
44
|
-
Initialize the SideBar.
|
|
45
|
-
|
|
46
|
-
Args:
|
|
47
|
-
st (Any): The Streamlit object for rendering UI components.
|
|
48
|
-
"""
|
|
49
|
-
self.st = st
|
|
50
|
-
|
|
51
|
-
def init_side_bar(self) -> None:
|
|
52
|
-
"""Initialize and render the sidebar components."""
|
|
53
|
-
with self.st.sidebar:
|
|
54
|
-
default_agent_type = (
|
|
55
|
-
"Remote URL" if os.path.exists("Dockerfile") else "Local Agent"
|
|
56
|
-
)
|
|
57
|
-
use_agent_path = self.st.selectbox(
|
|
58
|
-
"Select Agent Type",
|
|
59
|
-
["Local Agent", "Remote Agent Engine ID", "Remote URL"],
|
|
60
|
-
index=["Local Agent", "Remote Agent Engine ID", "Remote URL"].index(
|
|
61
|
-
default_agent_type
|
|
62
|
-
),
|
|
63
|
-
help="'Local Agent' uses a local implementation, 'Remote Agent Engine ID' connects to a deployed Vertex AI agent, and 'Remote URL' connects to a custom endpoint.",
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
if use_agent_path == "Local Agent":
|
|
67
|
-
self.agent_callable_path = self.st.text_input(
|
|
68
|
-
label="Agent Callable Path",
|
|
69
|
-
value=os.environ.get(
|
|
70
|
-
"AGENT_CALLABLE_PATH", DEFAULT_AGENT_CALLABLE_PATH
|
|
71
|
-
),
|
|
72
|
-
)
|
|
73
|
-
self.remote_agent_engine_id = None
|
|
74
|
-
self.url_input_field = None
|
|
75
|
-
self.should_authenticate_request = False
|
|
76
|
-
elif use_agent_path == "Remote Agent Engine ID":
|
|
77
|
-
self.remote_agent_engine_id = self.st.text_input(
|
|
78
|
-
label="Remote Agent Engine ID",
|
|
79
|
-
value=os.environ.get(
|
|
80
|
-
"REMOTE_AGENT_ENGINE_ID", DEFAULT_REMOTE_AGENT_ENGINE_ID
|
|
81
|
-
),
|
|
82
|
-
)
|
|
83
|
-
self.agent_callable_path = None
|
|
84
|
-
self.url_input_field = None
|
|
85
|
-
self.should_authenticate_request = False
|
|
86
|
-
else:
|
|
87
|
-
self.url_input_field = self.st.text_input(
|
|
88
|
-
label="Service URL",
|
|
89
|
-
value=os.environ.get("SERVICE_URL", DEFAULT_BASE_URL),
|
|
90
|
-
)
|
|
91
|
-
self.should_authenticate_request = self.st.checkbox(
|
|
92
|
-
label="Authenticate request",
|
|
93
|
-
value=False,
|
|
94
|
-
help="If checked, any request to the server will contain an"
|
|
95
|
-
"Identity token to allow authentication. "
|
|
96
|
-
"See the Cloud Run documentation to know more about authentication:"
|
|
97
|
-
"https://cloud.google.com/run/docs/authenticating/service-to-service",
|
|
98
|
-
)
|
|
99
|
-
self.agent_callable_path = None
|
|
100
|
-
self.remote_agent_engine_id = None
|
|
101
|
-
|
|
102
|
-
col1, col2, col3 = self.st.columns(3)
|
|
103
|
-
with col1:
|
|
104
|
-
if self.st.button("+ New chat"):
|
|
105
|
-
if (
|
|
106
|
-
len(
|
|
107
|
-
self.st.session_state.user_chats[
|
|
108
|
-
self.st.session_state["session_id"]
|
|
109
|
-
]["messages"]
|
|
110
|
-
)
|
|
111
|
-
> 0
|
|
112
|
-
):
|
|
113
|
-
self.st.session_state.run_id = None
|
|
114
|
-
|
|
115
|
-
self.st.session_state["session_id"] = str(uuid.uuid4())
|
|
116
|
-
self.st.session_state.session_db.get_session(
|
|
117
|
-
session_id=self.st.session_state["session_id"],
|
|
118
|
-
)
|
|
119
|
-
self.st.session_state.user_chats[
|
|
120
|
-
self.st.session_state["session_id"]
|
|
121
|
-
] = {
|
|
122
|
-
"title": EMPTY_CHAT_NAME,
|
|
123
|
-
"messages": [],
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
with col2:
|
|
127
|
-
if self.st.button("Delete chat"):
|
|
128
|
-
self.st.session_state.run_id = None
|
|
129
|
-
self.st.session_state.session_db.clear()
|
|
130
|
-
self.st.session_state.user_chats.pop(
|
|
131
|
-
self.st.session_state["session_id"]
|
|
132
|
-
)
|
|
133
|
-
if len(self.st.session_state.user_chats) > 0:
|
|
134
|
-
chat_id = list(self.st.session_state.user_chats.keys())[0]
|
|
135
|
-
self.st.session_state["session_id"] = chat_id
|
|
136
|
-
self.st.session_state.session_db.get_session(
|
|
137
|
-
session_id=self.st.session_state["session_id"],
|
|
138
|
-
)
|
|
139
|
-
else:
|
|
140
|
-
self.st.session_state["session_id"] = str(uuid.uuid4())
|
|
141
|
-
self.st.session_state.user_chats[
|
|
142
|
-
self.st.session_state["session_id"]
|
|
143
|
-
] = {
|
|
144
|
-
"title": EMPTY_CHAT_NAME,
|
|
145
|
-
"messages": [],
|
|
146
|
-
}
|
|
147
|
-
with col3:
|
|
148
|
-
if self.st.button("Save chat"):
|
|
149
|
-
save_chat(self.st)
|
|
150
|
-
|
|
151
|
-
self.st.subheader("Recent") # Style the heading
|
|
152
|
-
|
|
153
|
-
all_chats = list(reversed(self.st.session_state.user_chats.items()))
|
|
154
|
-
for chat_id, chat in all_chats[:NUM_CHAT_IN_RECENT]:
|
|
155
|
-
if self.st.button(chat["title"], key=chat_id):
|
|
156
|
-
self.st.session_state.run_id = None
|
|
157
|
-
self.st.session_state["session_id"] = chat_id
|
|
158
|
-
self.st.session_state.session_db.get_session(
|
|
159
|
-
session_id=self.st.session_state["session_id"],
|
|
160
|
-
)
|
|
161
|
-
|
|
162
|
-
with self.st.expander("Other chats"):
|
|
163
|
-
for chat_id, chat in all_chats[NUM_CHAT_IN_RECENT:]:
|
|
164
|
-
if self.st.button(chat["title"], key=chat_id):
|
|
165
|
-
self.st.session_state.run_id = None
|
|
166
|
-
self.st.session_state["session_id"] = chat_id
|
|
167
|
-
self.st.session_state.session_db.get_session(
|
|
168
|
-
session_id=self.st.session_state["session_id"],
|
|
169
|
-
)
|
|
170
|
-
|
|
171
|
-
self.st.divider()
|
|
172
|
-
self.st.header("Upload files from local")
|
|
173
|
-
bucket_name = self.st.text_input(
|
|
174
|
-
label="GCS Bucket for upload",
|
|
175
|
-
value=os.environ.get("BUCKET_NAME", "gs://your-bucket-name"),
|
|
176
|
-
)
|
|
177
|
-
if "checkbox_state" not in self.st.session_state:
|
|
178
|
-
self.st.session_state.checkbox_state = True
|
|
179
|
-
|
|
180
|
-
self.st.session_state.checkbox_state = self.st.checkbox(
|
|
181
|
-
"Upload to GCS first (suggested)", value=False, help=HELP_GCS_CHECKBOX
|
|
182
|
-
)
|
|
183
|
-
|
|
184
|
-
self.uploaded_files = self.st.file_uploader(
|
|
185
|
-
label="Send files from local",
|
|
186
|
-
accept_multiple_files=True,
|
|
187
|
-
key=f"uploader_images_{self.st.session_state.uploader_key}",
|
|
188
|
-
type=[
|
|
189
|
-
"png",
|
|
190
|
-
"jpg",
|
|
191
|
-
"jpeg",
|
|
192
|
-
"txt",
|
|
193
|
-
"docx",
|
|
194
|
-
"pdf",
|
|
195
|
-
"rtf",
|
|
196
|
-
"csv",
|
|
197
|
-
"tsv",
|
|
198
|
-
"xlsx",
|
|
199
|
-
],
|
|
200
|
-
)
|
|
201
|
-
if self.uploaded_files and self.st.session_state.checkbox_state:
|
|
202
|
-
upload_files_to_gcs(self.st, bucket_name, self.uploaded_files)
|
|
203
|
-
|
|
204
|
-
self.st.divider()
|
|
205
|
-
|
|
206
|
-
self.st.header("Upload files from GCS")
|
|
207
|
-
self.gcs_uris = self.st.text_area(
|
|
208
|
-
"GCS uris (comma-separated)",
|
|
209
|
-
value=self.st.session_state["gcs_uris_to_be_sent"],
|
|
210
|
-
key=f"upload_text_area_{self.st.session_state.uploader_key}",
|
|
211
|
-
help=HELP_MESSAGE_MULTIMODALITY,
|
|
212
|
-
)
|
|
213
|
-
|
|
214
|
-
self.st.caption(f"Note: {HELP_MESSAGE_MULTIMODALITY}")
|