User Interface¶
Purpose¶
This page documents the main Gipity UI application at a high level.
app.py is the application entry point. It coordinates the user interface, workflow selection,
session state, file upload handling, local document processing, result rendering, token tracking,
and calls into the provider wrappers.
Responsibilities¶
app.py is responsible for:
- Creating the Streamlit application shell.
- Initializing session state.
- Loading configuration values.
- Rendering mode-specific controls.
- Coordinating text, image, audio, embeddings, document, file, vector-store, prompt, and data workflows.
- Handling uploaded files.
- Rendering results and metrics.
- Tracking token usage where supported.
- Connecting the interface to provider wrappers in
gpt.py.
Import-Safety Notice¶
This page intentionally does not use a mkdocstrings directive for app.py.
The main application module performs Streamlit-oriented setup and state initialization. Since
mkdocstrings imports modules during documentation generation, importing the Streamlit runtime
module can cause documentation build failures or side effects.
Current Documentation Strategy¶
The documentation site uses mkdocstrings for:
::: config
::: gpt
The documentation site describes app.py manually.
Build Guidance¶
If the documentation build fails after adding app, remove that directive and keep this manual
page.
The safe initial API documentation targets are:
config.pygpt.py
API Reference¶
app ¶
Assembly: Gipity
Filename: name.py
Author: Terry D. Eppler
Created: 05-31-2022
Last Modified By: Terry D. Eppler
Last Modified On: 05-01-2025
app.py
Copyright © 2024 Terry Eppler
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
You can contact me at: terryeppler@gmail.com or eppler.terry@epa.gov
insert_data
module-attribute
¶
Insert data.
Purpose
Provides the insert data helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table_name
|
str
|
Value supplied to the helper. |
required |
df
|
DataFrame
|
Value supplied to the helper. |
required |
load_embedder ¶
Load embedder.
Purpose
Loads the embedder resource or state required by the Gipity workflow and returns the prepared value for caller use.
Returns:
| Type | Description |
|---|---|
SentenceTransformer
|
Value produced by the load_embedder helper according to its function annotation and |
SentenceTransformer
|
return statements. |
Source code in app.py
throw_if ¶
Throw if.
Purpose
Provides the throw if helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Value supplied to the helper. |
required |
value
|
object
|
Value supplied to the helper. |
required |
Raises:
| Type | Description |
|---|---|
Error
|
Re-raised after the exception is wrapped and written to the application logger. |
Source code in app.py
extract_usage ¶
Extract usage.
Purpose
Extracts token usage from OpenAI Responses API and legacy completion response objects. The function normalizes current input and output token fields into the application-facing prompt, completion, and total token schema used by existing Streamlit metrics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resp
|
Any
|
OpenAI response object or dictionary containing a usage payload. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, int]
|
Dict[ str, int ]: Normalized prompt, completion, and total token counts. |
Source code in app.py
1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 | |
update_token_counters ¶
Update token counters.
Purpose
Updates the token counters state or persisted value used by the Gipity workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resp
|
Any
|
Value supplied to the helper. |
required |
Source code in app.py
extract_response_text ¶
Extract response text.
Purpose
Extracts the response text value from the supplied object or payload while handling missing or unsupported content safely.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
object
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the extract_response_text helper according to its function annotation |
str
|
and return statements. |
Source code in app.py
encode_image ¶
Encode image.
Purpose
Provides the encode image helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_path
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the encode_image helper according to its function annotation and |
str
|
return statements. |
Source code in app.py
normalize_text ¶
Normalize text.
Purpose
Normalizes the text input into the stable shape expected by downstream Gipity helpers and display logic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the normalize_text helper according to its function annotation and |
str
|
return statements. |
Raises:
| Type | Description |
|---|---|
Error
|
Re-raised after the exception is wrapped and written to the application logger. |
Source code in app.py
chunk_text ¶
Chunk text.
Purpose
Provides the chunk text helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Value supplied to the helper. |
required |
max_tokens
|
int
|
Value supplied to the helper. |
400
|
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the chunk_text helper according to its function annotation and return |
List[str]
|
statements. |
Source code in app.py
cosine_sim ¶
Cosine sim.
Purpose
Provides the cosine sim helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ndarray
|
Value supplied to the helper. |
required |
b
|
ndarray
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Value produced by the cosine_sim helper according to its function annotation and return |
float
|
statements. |
Source code in app.py
sanitize_markdown ¶
Sanitize markdown.
Purpose
Provides the sanitize markdown helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the sanitize_markdown helper according to its function annotation and |
str
|
return statements. |
Raises:
| Type | Description |
|---|---|
Error
|
Re-raised after the exception is wrapped and written to the application logger. |
Source code in app.py
init_state ¶
Init state.
Purpose
Provides the init state helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Source code in app.py
reset_state ¶
Reset state.
Purpose
Resets the state state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
normalize ¶
Normalize.
Purpose
Provides the normalize helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
Value produced by the normalize helper according to its function annotation and return |
Any
|
statements. |
Raises:
| Type | Description |
|---|---|
Error
|
Re-raised after the exception is wrapped and written to the application logger. |
Source code in app.py
save_temp ¶
Save temp.
Purpose
Saves the temp value for later workflow use while preserving the caller-facing return contract.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
upload
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Value produced by the save_temp helper according to its function annotation and return |
str | None
|
statements. |
Source code in app.py
display_value ¶
Display value.
Purpose
Provides the display value helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
val
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the display_value helper according to its function annotation and |
str
|
return statements. |
Source code in app.py
format_results ¶
Format results.
Purpose
Provides the format results helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the format_results helper according to its function annotation and |
str
|
return statements. |
Source code in app.py
count_tokens ¶
Count tokens.
Purpose
Provides the count tokens helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Value produced by the count_tokens helper according to its function annotation and |
int
|
return statements. |
Source code in app.py
convert_xml ¶
Convert xml.
Purpose
Provides the convert xml helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the convert_xml helper according to its function annotation and return |
str
|
statements. |
Raises:
| Type | Description |
|---|---|
Error
|
Re-raised after the exception is wrapped and written to the application logger. |
Source code in app.py
convert_markdown ¶
Convert markdown.
Purpose
Provides the convert markdown helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the convert_markdown helper according to its function annotation and |
str
|
return statements. |
Source code in app.py
1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 | |
inject_response_css ¶
Inject response css.
Purpose
Provides the inject response css helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Source code in app.py
style_subheaders ¶
Style subheaders.
Purpose
Provides the style subheaders helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Source code in app.py
save_message ¶
Save message.
Purpose
Saves the message value for later workflow use while preserving the caller-facing return contract.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
role
|
str
|
Value supplied to the helper. |
required |
content
|
str
|
Value supplied to the helper. |
required |
Source code in app.py
load_history ¶
Load history.
Purpose
Loads the history resource or state required by the Gipity workflow and returns the prepared value for caller use.
Returns:
| Type | Description |
|---|---|
List[Tuple[str, str]]
|
Value produced by the load_history helper according to its function annotation and |
List[Tuple[str, str]]
|
return statements. |
Source code in app.py
clear_history ¶
Clear history.
Purpose
Clears the history state used by the current workflow so the user interface can start from a clean output state.
Source code in app.py
extract_sources ¶
Extract sources.
Purpose
Extracts web-search and file-search source metadata from an OpenAI Responses API response. The function preserves the application-facing source schema while mapping provider file search results to the correct singular file identifier field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
Any
|
OpenAI Responses API response object. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List[ Dict[ str, Any ] ]: Normalized source metadata used by the application. |
Source code in app.py
1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 | |
ensure_text_mode_state ¶
Ensure text mode state.
Purpose
Ensures the required text mode state session-state keys or runtime resources exist before the related interface controls are rendered.
Source code in app.py
parse_text_vector_store_ids ¶
Parse text vector store ids.
Purpose
Provides the parse text vector store ids helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str | List[str] | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the parse_text_vector_store_ids helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
build_text_response_format ¶
build_text_response_format(
response_format: str | None,
schema_name: str = None,
schema_text: str = None,
strict: bool = True,
) -> Dict[str, Any] | None
Build text response format.
Purpose
Builds the text response format value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response_format
|
str | None
|
Value supplied to the helper. |
required |
schema_name
|
str
|
Value supplied to the helper. |
None
|
schema_text
|
str
|
Value supplied to the helper. |
None
|
strict
|
bool
|
Value supplied to the helper. |
True
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | None
|
Value produced by the build_text_response_format helper according to its function |
Dict[str, Any] | None
|
annotation and return statements. |
Source code in app.py
build_text_tools ¶
build_text_tools(
selected_tools: List[str] | None,
vector_store_ids: List[str] = None,
) -> List[Dict[str, Any]]
Build text tools.
Purpose
Builds the text tools value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
selected_tools
|
List[str] | None
|
Value supplied to the helper. |
required |
vector_store_ids
|
List[str]
|
Value supplied to the helper. |
None
|
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
Value produced by the build_text_tools helper according to its function annotation and |
List[Dict[str, Any]]
|
return statements. |
Source code in app.py
build_text_include ¶
build_text_include(
selected_include: List[str] | None,
selected_tools: List[Dict[str, Any]] = None,
) -> List[str]
Build text include.
Purpose
Builds the text include value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
selected_include
|
List[str] | None
|
Value supplied to the helper. |
required |
selected_tools
|
List[Dict[str, Any]]
|
Value supplied to the helper. |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the build_text_include helper according to its function annotation and |
List[str]
|
return statements. |
Source code in app.py
build_text_tool_choice ¶
build_text_tool_choice(
tool_choice: str | None,
selected_tools: List[Dict[str, Any]] | None = None,
) -> str | None
Build text tool choice.
Purpose
Builds the text tool choice value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool_choice
|
str | None
|
Value supplied to the helper. |
required |
selected_tools
|
List[Dict[str, Any]] | None
|
Value supplied to the helper. |
None
|
Returns:
| Type | Description |
|---|---|
str | None
|
Value produced by the build_text_tool_choice helper according to its function annotation |
str | None
|
and return statements. |
Source code in app.py
build_text_context ¶
build_text_context(
messages: List[Dict[str, Any]] | None,
include_last_message: bool = False,
) -> List[Dict[str, str]]
Build text context.
Purpose
Builds the text context value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
messages
|
List[Dict[str, Any]] | None
|
Value supplied to the helper. |
required |
include_last_message
|
bool
|
Value supplied to the helper. |
False
|
Returns:
| Type | Description |
|---|---|
List[Dict[str, str]]
|
Value produced by the build_text_context helper according to its function annotation and |
List[Dict[str, str]]
|
return statements. |
Source code in app.py
get_text_conversation_id ¶
Get text conversation id.
Purpose
Returns the text conversation id value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mode
|
str | None
|
Value supplied to the helper. |
required |
conversation_id
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Value produced by the get_text_conversation_id helper according to its function |
str | None
|
annotation and return statements. |
Source code in app.py
get_text_previous_response_id ¶
Get text previous response id.
Purpose
Returns the text previous response id value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mode
|
str | None
|
Value supplied to the helper. |
required |
previous_id
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Value produced by the get_text_previous_response_id helper according to its function |
str | None
|
annotation and return statements. |
Source code in app.py
get_text_stream_value ¶
Get text stream value.
Purpose
Returns the text stream value value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stream_value
|
bool | None
|
Value supplied to the helper. |
required |
Source code in app.py
get_text_background_value ¶
Get text background value.
Purpose
Returns the text background value value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
background_value
|
bool | None
|
Value supplied to the helper. |
required |
Source code in app.py
reset_text_structured_output_controls ¶
Reset text structured output controls.
Purpose
Resets the text structured output controls state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
reset_text_api_state_controls ¶
Reset text api state controls.
Purpose
Resets the text api state controls state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
clear_image_messages ¶
Clear image messages.
Purpose
Clears the image messages state used by the current workflow so the user interface can start from a clean output state.
Source code in app.py
clear_image_instructions ¶
Clear image instructions.
Purpose
Clears the image instructions state used by the current workflow so the user interface can start from a clean output state.
Source code in app.py
append_image_message ¶
Append image message.
Purpose
Provides the append image message helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
role
|
str
|
Value supplied to the helper. |
required |
content
|
str
|
Value supplied to the helper. |
required |
Source code in app.py
load_image_instruction_template ¶
Load image instruction template.
Purpose
Loads the image instruction template resource or state required by the Gipity workflow and returns the prepared value for caller use.
Source code in app.py
convert_image_system_instructions ¶
Convert image system instructions.
Purpose
Provides the convert image system instructions helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Source code in app.py
reset_image_llm_settings ¶
Reset image llm settings.
Purpose
Resets the image llm settings state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
reset_image_visual_settings ¶
Reset image visual settings.
Purpose
Resets the image visual settings state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
get_image_models ¶
Get image models.
Purpose
Returns the image models value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Images
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_image_models helper according to its function annotation and |
List[str]
|
return statements. |
Source code in app.py
get_image_analysis_models ¶
Get image analysis models.
Purpose
Returns the image analysis models value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Images
|
Value supplied to the helper. |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_image_analysis_models helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_image_size_options ¶
Get image size options.
Purpose
Returns the image size options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Images
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_image_size_options helper according to its function annotation |
List[str]
|
and return statements. |
Source code in app.py
get_image_quality_options ¶
Get image quality options.
Purpose
Returns the image quality options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Images
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_image_quality_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_image_mime_options ¶
Get image mime options.
Purpose
Returns the image mime options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Images
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_image_mime_options helper according to its function annotation |
List[str]
|
and return statements. |
Source code in app.py
get_image_background_options ¶
Get image background options.
Purpose
Returns the image background options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Images
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_image_background_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_image_detail_options ¶
Get image detail options.
Purpose
Returns the image detail options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Images
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_image_detail_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
render_image_output ¶
render_image_output(
image_result: str | bytes | List[str | bytes] | None,
caption: str = "Image output",
) -> bool
Render image output.
Purpose
Renders the image output user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_result
|
str | bytes | List[str | bytes] | None
|
Value supplied to the helper. |
required |
caption
|
str
|
Value supplied to the helper. |
'Image output'
|
Returns:
| Type | Description |
|---|---|
bool
|
Value produced by the render_image_output helper according to its function annotation |
bool
|
and return statements. |
Source code in app.py
ensure_embeddings_mode_state ¶
Ensure embeddings mode state.
Purpose
Ensures the required embeddings mode state session-state keys or runtime resources exist before the related interface controls are rendered.
Source code in app.py
get_embedding_model_options ¶
Get embedding model options.
Purpose
Returns the embedding model options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
embedding
|
Embeddings
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_embedding_model_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_embedding_encoding_options ¶
Get embedding encoding options.
Purpose
Returns the embedding encoding options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
embedding
|
Embeddings
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_embedding_encoding_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_embedding_max_dimensions ¶
Get embedding max dimensions.
Purpose
Returns the embedding max dimensions value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
str | None
|
Value supplied to the helper. |
required |
embedding
|
Embeddings
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Value produced by the get_embedding_max_dimensions helper according to its function |
int
|
annotation and return statements. |
Source code in app.py
embedding_model_supports_dimensions ¶
Embedding model supports dimensions.
Purpose
Provides the embedding model supports dimensions helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
str | None
|
Value supplied to the helper. |
required |
embedding
|
Embeddings
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Value produced by the embedding_model_supports_dimensions helper according to its |
bool
|
function annotation and return statements. |
Source code in app.py
normalize_embedding_dimensions ¶
normalize_embedding_dimensions(
model: str | None,
dimensions: int | None,
embedding: Embeddings,
) -> int | None
Normalize embedding dimensions.
Purpose
Normalizes the embedding dimensions input into the stable shape expected by downstream Gipity helpers and display logic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
str | None
|
Value supplied to the helper. |
required |
dimensions
|
int | None
|
Value supplied to the helper. |
required |
embedding
|
Embeddings
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
int | None
|
Value produced by the normalize_embedding_dimensions helper according to its function |
int | None
|
annotation and return statements. |
Source code in app.py
normalize_embedding_chunk_settings ¶
normalize_embedding_chunk_settings(
chunk_size: int | None, overlap_amount: int | None
) -> tuple[int, int]
Normalize embedding chunk settings.
Purpose
Normalizes the embedding chunk settings input into the stable shape expected by downstream Gipity helpers and display logic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chunk_size
|
int | None
|
Value supplied to the helper. |
required |
overlap_amount
|
int | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Value produced by the normalize_embedding_chunk_settings helper according to its |
int
|
function annotation and return statements. |
Source code in app.py
chunk_text_for_embeddings ¶
chunk_text_for_embeddings(
text: str,
chunk_size: int = 800,
overlap_amount: int = 0,
encoding_name: str = "cl100k_base",
) -> List[str]
Chunk text for embeddings.
Purpose
Provides the chunk text for embeddings helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Value supplied to the helper. |
required |
chunk_size
|
int
|
Value supplied to the helper. |
800
|
overlap_amount
|
int
|
Value supplied to the helper. |
0
|
encoding_name
|
str
|
Value supplied to the helper. |
'cl100k_base'
|
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the chunk_text_for_embeddings helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
normalize_embedding_vectors ¶
Normalize embedding vectors.
Purpose
Normalizes the embedding vectors input into the stable shape expected by downstream Gipity helpers and display logic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vectors
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[Any]
|
Value produced by the normalize_embedding_vectors helper according to its function |
List[Any]
|
annotation and return statements. |
Source code in app.py
build_embeddings_dataframe ¶
build_embeddings_dataframe(
chunks: List[str],
vectors: Any,
encoding_format: str = "float",
) -> pd.DataFrame
Build embeddings dataframe.
Purpose
Builds the embeddings dataframe value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chunks
|
List[str]
|
Value supplied to the helper. |
required |
vectors
|
Any
|
Value supplied to the helper. |
required |
encoding_format
|
str
|
Value supplied to the helper. |
'float'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Value produced by the build_embeddings_dataframe helper according to its function |
DataFrame
|
annotation and return statements. |
Source code in app.py
get_embedding_vector_dimension ¶
Get embedding vector dimension.
Purpose
Returns the embedding vector dimension value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vectors
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Value produced by the get_embedding_vector_dimension helper according to its function |
int
|
annotation and return statements. |
Source code in app.py
extract_embedding_usage ¶
Extract embedding usage.
Purpose
Extracts the embedding usage value from the supplied object or payload while handling missing or unsupported content safely.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the extract_embedding_usage helper according to its function |
Dict[str, Any]
|
annotation and return statements. |
Source code in app.py
build_embedding_metrics ¶
build_embedding_metrics(
source_text: str,
normalized_text: str,
chunks: List[str],
vectors: Any,
usage: Dict[str, Any] | None = None,
) -> Dict[str, Any]
Build embedding metrics.
Purpose
Builds the embedding metrics value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_text
|
str
|
Value supplied to the helper. |
required |
normalized_text
|
str
|
Value supplied to the helper. |
required |
chunks
|
List[str]
|
Value supplied to the helper. |
required |
vectors
|
Any
|
Value supplied to the helper. |
required |
usage
|
Dict[str, Any] | None
|
Value supplied to the helper. |
None
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the build_embedding_metrics helper according to its function |
Dict[str, Any]
|
annotation and return statements. |
Source code in app.py
render_embedding_metrics ¶
Render embedding metrics.
Purpose
Renders the embedding metrics user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metrics
|
Dict[str, Any] | None
|
Value supplied to the helper. |
required |
Source code in app.py
render_embeddings_dataframe ¶
Render embeddings dataframe.
Purpose
Renders the embeddings dataframe user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df_embeddings
|
DataFrame
|
Value supplied to the helper. |
required |
Source code in app.py
reset_embeddings_controls ¶
Reset embeddings controls.
Purpose
Resets the embeddings controls state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
clear_embeddings_output ¶
Clear embeddings output.
Purpose
Clears the embeddings output state used by the current workflow so the user interface can start from a clean output state.
Source code in app.py
reset_embeddings_all ¶
Reset embeddings all.
Purpose
Resets the embeddings all state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
load_sqlite_vec ¶
Load sqlite vec.
Purpose
Loads the sqlite vec resource or state required by the Gipity workflow and returns the prepared value for caller use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn
|
Connection
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Value produced by the load_sqlite_vec helper according to its function annotation and |
bool
|
return statements. |
Source code in app.py
ensure_vec_schema ¶
Ensure vec schema.
Purpose
Ensures the required vec schema session-state keys or runtime resources exist before the related interface controls are rendered.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dim
|
int
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Value produced by the ensure_vec_schema helper according to its function annotation and |
bool
|
return statements. |
Source code in app.py
rebuild_index ¶
Rebuild index.
Purpose
Provides the rebuild index helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
embedder
|
SentenceTransformer
|
Value supplied to the helper. |
required |
Source code in app.py
2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 | |
retrieve_top_doc_chunks ¶
Retrieve top doc chunks.
Purpose
Provides the retrieve top doc chunks helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Value supplied to the helper. |
required |
k
|
int
|
Value supplied to the helper. |
6
|
Returns:
| Type | Description |
|---|---|
List[Tuple[str, str, float]]
|
Value produced by the retrieve_top_doc_chunks helper according to its function |
List[Tuple[str, str, float]]
|
annotation and return statements. |
Source code in app.py
build_document_user_input ¶
Build document user input.
Purpose
Builds the document user input value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_query
|
str
|
Value supplied to the helper. |
required |
k
|
int
|
Value supplied to the helper. |
6
|
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the build_document_user_input helper according to its function |
str
|
annotation and return statements. |
Source code in app.py
extract_text_from_bytes ¶
Extract text from bytes.
Purpose
Extracts text from bytes for downstream application use. The function normalizes provider or file-system data into a stable shape that the Streamlit interface and helper workflows can consume safely.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_bytes
|
bytes
|
File bytes value used by this workflow. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the operation for display or downstream processing. |
Source code in app.py
extract_docqna_pdf_text ¶
Extract docqna pdf text.
Purpose
Extracts the docqna pdf text value from the supplied object or payload while handling missing or unsupported content safely.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_bytes
|
bytes
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the extract_docqna_pdf_text helper according to its function |
str
|
annotation and return statements. |
Source code in app.py
extract_docqna_text_file ¶
Extract docqna text file.
Purpose
Extracts the docqna text file value from the supplied object or payload while handling missing or unsupported content safely.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_bytes
|
bytes
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the extract_docqna_text_file helper according to its function |
str
|
annotation and return statements. |
Source code in app.py
extract_docqna_docx_text ¶
Extract docqna docx text.
Purpose
Extracts the docqna docx text value from the supplied object or payload while handling missing or unsupported content safely.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_bytes
|
bytes
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the extract_docqna_docx_text helper according to its function |
str
|
annotation and return statements. |
Source code in app.py
extract_docqna_text ¶
Extract docqna text.
Purpose
Extracts the docqna text value from the supplied object or payload while handling missing or unsupported content safely.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Value supplied to the helper. |
required |
file_bytes
|
bytes
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the extract_docqna_text helper according to its function annotation |
str
|
and return statements. |
Source code in app.py
ensure_docqna_mode_state ¶
Ensure docqna mode state.
Purpose
Ensures the required docqna mode state session-state keys or runtime resources exist before the related interface controls are rendered.
Source code in app.py
3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 | |
clear_docqna_messages ¶
Clear docqna messages.
Purpose
Clears the docqna messages state used by the current workflow so the user interface can start from a clean output state.
clear_docqna_outputs ¶
Clear docqna outputs.
Purpose
Clears the docqna outputs state used by the current workflow so the user interface can start from a clean output state.
Source code in app.py
unload_docqna_documents ¶
Unload docqna documents.
Purpose
Provides the unload docqna documents helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Source code in app.py
reset_docqna_controls ¶
Reset docqna controls.
Purpose
Resets the docqna controls state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
reset_docqna_all ¶
Reset docqna all.
Purpose
Resets the docqna all state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
clear_docqna_instructions ¶
Clear docqna instructions.
Purpose
Clears the docqna instructions state used by the current workflow so the user interface can start from a clean output state.
Source code in app.py
load_docqna_instruction_template ¶
Load docqna instruction template.
Purpose
Loads the docqna instruction template resource or state required by the Gipity workflow and returns the prepared value for caller use.
Source code in app.py
convert_docqna_system_instructions ¶
Convert docqna system instructions.
Purpose
Provides the convert docqna system instructions helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Source code in app.py
get_docqna_source_options ¶
Get docqna source options.
Purpose
Returns the docqna source options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_docqna_source_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_docqna_file_extension ¶
Get docqna file extension.
Purpose
Returns the docqna file extension value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the get_docqna_file_extension helper according to its function |
str
|
annotation and return statements. |
Source code in app.py
compute_docqna_fingerprint ¶
Compute docqna fingerprint.
Purpose
Provides the compute docqna fingerprint helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
documents
|
List[Dict[str, Any]]
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the compute_docqna_fingerprint helper according to its function |
str
|
annotation and return statements. |
Source code in app.py
compute_fingerprint ¶
Compute fingerprint.
Purpose
Provides the compute fingerprint helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_bytes
|
bytes | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the compute_fingerprint helper according to its function annotation |
str
|
and return statements. |
Source code in app.py
load_docqna_uploaded_files ¶
Load docqna uploaded files.
Purpose
Loads the docqna uploaded files resource or state required by the Gipity workflow and returns the prepared value for caller use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uploaded
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
Value produced by the load_docqna_uploaded_files helper according to its function |
List[Dict[str, Any]]
|
annotation and return statements. |
Source code in app.py
get_docqna_active_document_names ¶
Get docqna active document names.
Purpose
Returns the docqna active document names value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_docqna_active_document_names helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_docqna_active_bytes ¶
Get docqna active bytes.
Purpose
Returns the docqna active bytes value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Returns:
| Type | Description |
|---|---|
bytes | None
|
Value produced by the get_docqna_active_bytes helper according to its function |
bytes | None
|
annotation and return statements. |
Source code in app.py
render_docqna_document_preview ¶
Render docqna document preview.
Purpose
Renders the docqna document preview user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Source code in app.py
normalize_docqna_text ¶
Normalize docqna text.
Purpose
Normalizes the docqna text input into the stable shape expected by downstream Gipity helpers and display logic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the normalize_docqna_text helper according to its function annotation |
str
|
and return statements. |
Source code in app.py
chunk_docqna_text ¶
Chunk docqna text.
Purpose
Provides the chunk docqna text helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Value supplied to the helper. |
required |
chunk_size
|
int
|
Value supplied to the helper. |
900
|
chunk_overlap
|
int
|
Value supplied to the helper. |
150
|
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the chunk_docqna_text helper according to its function annotation and |
List[str]
|
return statements. |
Source code in app.py
rebuild_docqna_index ¶
Rebuild docqna index.
Purpose
Provides the rebuild docqna index helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
Value produced by the rebuild_docqna_index helper according to its function annotation |
List[Dict[str, Any]]
|
and return statements. |
Source code in app.py
tokenize_docqna_query ¶
Tokenize docqna query.
Purpose
Provides the tokenize docqna query helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the tokenize_docqna_query helper according to its function annotation |
List[str]
|
and return statements. |
Source code in app.py
score_docqna_chunk ¶
Score docqna chunk.
Purpose
Provides the score docqna chunk helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query_tokens
|
List[str]
|
Value supplied to the helper. |
required |
chunk_text
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Value produced by the score_docqna_chunk helper according to its function annotation and |
float
|
return statements. |
Source code in app.py
retrieve_docqna_chunks ¶
Retrieve docqna chunks.
Purpose
Provides the retrieve docqna chunks helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Value supplied to the helper. |
required |
top_k
|
int | None
|
Value supplied to the helper. |
None
|
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
Value produced by the retrieve_docqna_chunks helper according to its function annotation |
List[Dict[str, Any]]
|
and return statements. |
Source code in app.py
build_docqna_local_prompt ¶
Build docqna local prompt.
Purpose
Builds the docqna local prompt value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Value supplied to the helper. |
required |
hits
|
List[Dict[str, Any]]
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the build_docqna_local_prompt helper according to its function |
str
|
annotation and return statements. |
Source code in app.py
docqna_call_openai_text_model ¶
Docqna call openai text model.
Purpose
Provides the docqna call openai text model helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prompt
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the docqna_call_openai_text_model helper according to its function |
str
|
annotation and return statements. |
Source code in app.py
3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 | |
run_docqna_local_query ¶
Run docqna local query.
Purpose
Runs the docqna local query workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the run_docqna_local_query helper according to its function annotation |
str
|
and return statements. |
Source code in app.py
run_docqna_file_query ¶
Run docqna file query.
Purpose
Runs the docqna file query workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the run_docqna_file_query helper according to its function annotation |
str
|
and return statements. |
Source code in app.py
run_docqna_vector_store_query ¶
Run docqna vector store query.
Purpose
Runs the docqna vector store query workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the run_docqna_vector_store_query helper according to its function |
str
|
annotation and return statements. |
Source code in app.py
route_document_query ¶
Route document query.
Purpose
Provides the route document query helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prompt
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the route_document_query helper according to its function annotation |
str
|
and return statements. |
Source code in app.py
summarize_active_document ¶
Summarize active document.
Purpose
Provides the summarize active document helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the summarize_active_document helper according to its function |
str
|
annotation and return statements. |
Source code in app.py
render_docqna_retrieval_hits ¶
Render docqna retrieval hits.
Purpose
Renders the docqna retrieval hits user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Source code in app.py
render_docqna_status ¶
Render docqna status.
Purpose
Renders the docqna status user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Source code in app.py
ensure_files_mode_state ¶
Ensure files mode state.
Purpose
Ensures the required files mode state session-state keys or runtime resources exist before the related interface controls are rendered.
Source code in app.py
get_files_upload_purpose_options ¶
Get files upload purpose options.
Purpose
Returns the files upload purpose options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
Files
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_files_upload_purpose_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_files_filter_purpose_options ¶
Get files filter purpose options.
Purpose
Returns the files filter purpose options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
Files
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_files_filter_purpose_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_files_model_options ¶
Get files model options.
Purpose
Returns the files model options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
Files
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_files_model_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
save_files_upload ¶
Save files upload.
Purpose
Saves the files upload value for later workflow use while preserving the caller-facing return contract.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uploaded_file
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Value produced by the save_files_upload helper according to its function annotation and |
str | None
|
return statements. |
Source code in app.py
normalize_files_table ¶
Normalize files table.
Purpose
Normalizes the files table input into the stable shape expected by downstream Gipity helpers and display logic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
Value produced by the normalize_files_table helper according to its function annotation |
List[Dict[str, Any]]
|
and return statements. |
Source code in app.py
build_files_dataframe ¶
Build files dataframe.
Purpose
Builds the files dataframe value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
List[Dict[str, Any]]
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Value produced by the build_files_dataframe helper according to its function annotation |
DataFrame
|
and return statements. |
Source code in app.py
build_file_selection_options ¶
Build file selection options.
Purpose
Builds the file selection options value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
List[Dict[str, Any]]
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
Value produced by the build_file_selection_options helper according to its function |
Dict[str, str]
|
annotation and return statements. |
Source code in app.py
get_selected_file_id ¶
get_selected_file_id(
selected_label: str | None,
options: Dict[str, str] | None = None,
) -> str | None
Get selected file id.
Purpose
Returns the selected file id value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
selected_label
|
str | None
|
Value supplied to the helper. |
required |
options
|
Dict[str, str] | None
|
Value supplied to the helper. |
None
|
Returns:
| Type | Description |
|---|---|
str | None
|
Value produced by the get_selected_file_id helper according to its function annotation |
str | None
|
and return statements. |
Source code in app.py
render_files_table ¶
Render files table.
Purpose
Renders the files table user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
List[Dict[str, Any]]
|
Value supplied to the helper. |
required |
Source code in app.py
render_file_metadata ¶
Render file metadata.
Purpose
Renders the file metadata user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata
|
Dict[str, Any] | None
|
Value supplied to the helper. |
required |
Source code in app.py
render_file_content ¶
Render file content.
Purpose
Renders the file content user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str | bytes | Dict[str, Any] | None
|
Value supplied to the helper. |
required |
Source code in app.py
render_file_delete_result ¶
Render file delete result.
Purpose
Renders the file delete result user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
Dict[str, Any] | None
|
Value supplied to the helper. |
required |
Source code in app.py
clear_files_messages ¶
Clear files messages.
Purpose
Clears the files messages state used by the current workflow so the user interface can start from a clean output state.
clear_files_outputs ¶
Clear files outputs.
Purpose
Clears the files outputs state used by the current workflow so the user interface can start from a clean output state.
Source code in app.py
reset_files_controls ¶
Reset files controls.
Purpose
Resets the files controls state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
reset_files_all ¶
Reset files all.
Purpose
Resets the files all state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
clear_files_instructions ¶
Clear files instructions.
Purpose
Clears the files instructions state used by the current workflow so the user interface can start from a clean output state.
Source code in app.py
load_files_instruction_template ¶
Load files instruction template.
Purpose
Loads the files instruction template resource or state required by the Gipity workflow and returns the prepared value for caller use.
Source code in app.py
convert_files_system_instructions ¶
Convert files system instructions.
Purpose
Provides the convert files system instructions helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Source code in app.py
run_files_upload ¶
Run files upload.
Purpose
Runs the files upload workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
Files
|
Value supplied to the helper. |
required |
uploaded_file
|
Any
|
Value supplied to the helper. |
required |
purpose
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the run_files_upload helper according to its function annotation and |
Dict[str, Any]
|
return statements. |
Source code in app.py
run_files_list ¶
Run files list.
Purpose
Runs the files list workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
Files
|
Value supplied to the helper. |
required |
purpose
|
str | None
|
Value supplied to the helper. |
None
|
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
Value produced by the run_files_list helper according to its function annotation and |
List[Dict[str, Any]]
|
return statements. |
Source code in app.py
run_files_retrieve ¶
Run files retrieve.
Purpose
Runs the files retrieve workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
Files
|
Value supplied to the helper. |
required |
file_id
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the run_files_retrieve helper according to its function annotation and |
Dict[str, Any]
|
return statements. |
Source code in app.py
run_files_extract ¶
Run files extract.
Purpose
Retrieves downloadable content for a selected OpenAI file when the file purpose supports content retrieval. Input files intended for model or Vector Store use are identified before the content endpoint is called so unsupported requests do not reach the provider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
Files
|
OpenAI Files API wrapper. |
required |
file_id
|
str | None
|
Selected OpenAI file identifier. |
required |
Returns:
| Type | Description |
|---|---|
str | bytes | Dict[str, Any] | None
|
str | bytes | Dict[ str, Any ] | None: Retrieved file content when supported, otherwise no |
str | bytes | Dict[str, Any] | None
|
value. |
Source code in app.py
run_files_delete ¶
Run files delete.
Purpose
Runs the files delete workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
Files
|
Value supplied to the helper. |
required |
file_id
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the run_files_delete helper according to its function annotation and |
Dict[str, Any]
|
return statements. |
Source code in app.py
run_files_analysis ¶
run_files_analysis(
files: Files,
file_id: str | None,
prompt: str | None,
model: str | None = None,
) -> str | None
Run files analysis.
Purpose
Runs the files analysis workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
Files
|
Value supplied to the helper. |
required |
file_id
|
str | None
|
Value supplied to the helper. |
required |
prompt
|
str | None
|
Value supplied to the helper. |
required |
model
|
str | None
|
Value supplied to the helper. |
None
|
Returns:
| Type | Description |
|---|---|
str | None
|
Value produced by the run_files_analysis helper according to its function annotation and |
str | None
|
return statements. |
Source code in app.py
resolve_files_current_id ¶
Resolve current Files API file identifier.
Purpose
Resolves the active OpenAI file identifier using the Files mode's established precedence: a selected listed file, a manually entered file identifier, and finally the persisted file identifier created by upload or prior selection.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Resolved OpenAI file identifier or an empty string when no file is available. |
Source code in app.py
get_configured_vector_store_names ¶
Get configured vector store names.
Purpose
Returns the configured OpenAI Vector Store display names in their declared order.
Returns:
| Type | Description |
|---|---|
List[str]
|
List[ str ]: Configured Vector Store display names. |
Source code in app.py
get_vector_store_ids ¶
Get vector store IDs.
Purpose
Resolves configured Vector Store display names into OpenAI Vector Store identifiers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
names
|
List[str] | None
|
Selected configured Vector Store names. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
List[ str ]: Resolved OpenAI Vector Store identifiers. |
Source code in app.py
get_vector_store_id ¶
Get vector store ID.
Purpose
Resolves one configured Vector Store display name into its OpenAI Vector Store identifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Selected configured Vector Store name. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Resolved OpenAI Vector Store identifier or an empty string. |
Source code in app.py
ensure_vectorstores_mode_state ¶
Ensure vectorstores mode state.
Purpose
Ensures the required vectorstores mode state session-state keys or runtime resources exist before the related interface controls are rendered.
Source code in app.py
4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 | |
get_vector_store_model_options ¶
Get vector store model options.
Purpose
Returns the vector store model options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_vector_store_model_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_vector_store_ranker_options ¶
Get vector store ranker options.
Purpose
Returns the vector store ranker options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_vector_store_ranker_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_vector_store_chunking_options ¶
Get vector store chunking options.
Purpose
Returns the vector store chunking options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_vector_store_chunking_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
parse_vector_store_file_ids ¶
Parse vector store file ids.
Purpose
Provides the parse vector store file ids helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str | List[str] | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the parse_vector_store_file_ids helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
parse_vector_store_json ¶
Parse vector store json.
Purpose
Provides the parse vector store json helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str | None
|
Value supplied to the helper. |
required |
label
|
str
|
Value supplied to the helper. |
'JSON'
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the parse_vector_store_json helper according to its function |
Dict[str, Any]
|
annotation and return statements. |
Source code in app.py
build_vector_store_expires_after_from_state ¶
Build vector store expires after from state.
Purpose
Builds the vector store expires after from state value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | None
|
Value produced by the build_vector_store_expires_after_from_state helper according to |
Dict[str, Any] | None
|
its function annotation and return statements. |
Source code in app.py
build_vector_store_chunking_strategy_from_state ¶
Build vector store chunking strategy from state.
Purpose
Builds the vector store chunking strategy from state value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | None
|
Value produced by the build_vector_store_chunking_strategy_from_state helper according |
Dict[str, Any] | None
|
to its function annotation and return statements. |
Source code in app.py
build_vector_store_ranking_options_from_state ¶
Build vector store ranking options from state.
Purpose
Builds the vector store ranking options from state value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the build_vector_store_ranking_options_from_state helper according to |
Dict[str, Any]
|
its function annotation and return statements. |
Source code in app.py
normalize_vector_store_rows ¶
Normalize vector store rows.
Purpose
Normalizes the vector store rows input into the stable shape expected by downstream Gipity helpers and display logic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
Value produced by the normalize_vector_store_rows helper according to its function |
List[Dict[str, Any]]
|
annotation and return statements. |
Source code in app.py
normalize_vector_store_file_rows ¶
Normalize vector store file rows.
Purpose
Normalizes the vector store file rows input into the stable shape expected by downstream Gipity helpers and display logic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
Value produced by the normalize_vector_store_file_rows helper according to its function |
List[Dict[str, Any]]
|
annotation and return statements. |
Source code in app.py
build_vector_stores_dataframe ¶
Build vector stores dataframe.
Purpose
Builds the vector stores dataframe value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
List[Dict[str, Any]]
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Value produced by the build_vector_stores_dataframe helper according to its function |
DataFrame
|
annotation and return statements. |
Source code in app.py
build_vector_store_files_dataframe ¶
Build vector store files dataframe.
Purpose
Builds the vector store files dataframe value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
List[Dict[str, Any]]
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Value produced by the build_vector_store_files_dataframe helper according to its |
DataFrame
|
function annotation and return statements. |
Source code in app.py
build_vector_store_selection_options ¶
Build vector store selection options.
Purpose
Builds the vector store selection options value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
List[Dict[str, Any]]
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
Value produced by the build_vector_store_selection_options helper according to its |
Dict[str, str]
|
function annotation and return statements. |
Source code in app.py
get_selected_vector_store_id ¶
get_selected_vector_store_id(
selected_label: str | None,
options: Dict[str, str] | None = None,
) -> str | None
Get selected vector store id.
Purpose
Returns the selected vector store id value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
selected_label
|
str | None
|
Value supplied to the helper. |
required |
options
|
Dict[str, str] | None
|
Value supplied to the helper. |
None
|
Returns:
| Type | Description |
|---|---|
str | None
|
Value produced by the get_selected_vector_store_id helper according to its function |
str | None
|
annotation and return statements. |
Source code in app.py
build_vector_store_file_selection_options ¶
Build vector store file selection options.
Purpose
Builds the vector store file selection options value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
List[Dict[str, Any]]
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
Value produced by the build_vector_store_file_selection_options helper according to its |
Dict[str, str]
|
function annotation and return statements. |
Source code in app.py
get_selected_vector_store_file_id ¶
get_selected_vector_store_file_id(
selected_label: str | None,
options: Dict[str, str] | None = None,
) -> str | None
Get selected vector store file id.
Purpose
Returns the selected vector store file id value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
selected_label
|
str | None
|
Value supplied to the helper. |
required |
options
|
Dict[str, str] | None
|
Value supplied to the helper. |
None
|
Returns:
| Type | Description |
|---|---|
str | None
|
Value produced by the get_selected_vector_store_file_id helper according to its function |
str | None
|
annotation and return statements. |
Source code in app.py
render_vector_stores_table ¶
Render vector stores table.
Purpose
Renders the vector stores table user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
List[Dict[str, Any]]
|
Value supplied to the helper. |
required |
Source code in app.py
render_vector_store_metadata ¶
Render vector store metadata.
Purpose
Renders the vector store metadata user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata
|
Dict[str, Any] | None
|
Value supplied to the helper. |
required |
Source code in app.py
render_vector_store_files_table ¶
Render vector store files table.
Purpose
Renders the vector store files table user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
List[Dict[str, Any]]
|
Value supplied to the helper. |
required |
Source code in app.py
render_vector_store_search_results ¶
Render vector store search results.
Purpose
Renders the vector store search results user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results
|
List[Dict[str, Any]]
|
Value supplied to the helper. |
required |
Source code in app.py
render_vector_store_batch_result ¶
Render vector store batch result.
Purpose
Renders the vector store batch result user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
Dict[str, Any] | None
|
Value supplied to the helper. |
required |
Source code in app.py
clear_vector_store_outputs ¶
Clear vector store outputs.
Purpose
Clears the vector store outputs state used by the current workflow so the user interface can start from a clean output state.
Source code in app.py
clear_vector_store_messages ¶
Clear vector store messages.
Purpose
Clears the vector store messages state used by the current workflow so the user interface can start from a clean output state.
Source code in app.py
reset_vector_store_controls ¶
Reset vector store controls.
Purpose
Resets the vector store controls state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
reset_vector_store_all ¶
Reset vector store all.
Purpose
Resets the vector store all state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
clear_vector_store_instructions ¶
Clear vector store instructions.
Purpose
Clears the vector store instructions state used by the current workflow so the user interface can start from a clean output state.
Source code in app.py
load_vector_store_instruction_template ¶
Load vector store instruction template.
Purpose
Loads the vector store instruction template resource or state required by the Gipity workflow and returns the prepared value for caller use.
Source code in app.py
convert_vector_store_system_instructions ¶
Convert vector store system instructions.
Purpose
Provides the convert vector store system instructions helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Source code in app.py
run_vector_store_create ¶
Run vector store create.
Purpose
Runs the vector store create workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the run_vector_store_create helper according to its function |
Dict[str, Any]
|
annotation and return statements. |
Source code in app.py
run_vector_store_list ¶
Run vector store list.
Purpose
Runs the vector store list workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
Value produced by the run_vector_store_list helper according to its function annotation |
List[Dict[str, Any]]
|
and return statements. |
Source code in app.py
run_vector_store_retrieve ¶
Run vector store retrieve.
Purpose
Runs the vector store retrieve workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
store_id
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the run_vector_store_retrieve helper according to its function |
Dict[str, Any]
|
annotation and return statements. |
Source code in app.py
run_vector_store_update ¶
Run vector store update.
Purpose
Runs the vector store update workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
store_id
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the run_vector_store_update helper according to its function |
Dict[str, Any]
|
annotation and return statements. |
Source code in app.py
run_vector_store_delete ¶
Run vector store delete.
Purpose
Runs the vector store delete workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
store_id
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the run_vector_store_delete helper according to its function |
Dict[str, Any]
|
annotation and return statements. |
Source code in app.py
run_vector_store_attach_file ¶
Run vector store attach file.
Purpose
Runs the vector store attach file workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
store_id
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the run_vector_store_attach_file helper according to its function |
Dict[str, Any]
|
annotation and return statements. |
Source code in app.py
run_vector_store_list_files ¶
Run vector store list files.
Purpose
Runs the vector store list files workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
store_id
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
Value produced by the run_vector_store_list_files helper according to its function |
List[Dict[str, Any]]
|
annotation and return statements. |
Source code in app.py
run_vector_store_delete_file ¶
run_vector_store_delete_file(
vector: VectorStores,
store_id: str | None,
file_id: str | None,
) -> Dict[str, Any]
Run vector store delete file.
Purpose
Runs the vector store delete file workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
store_id
|
str | None
|
Value supplied to the helper. |
required |
file_id
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the run_vector_store_delete_file helper according to its function |
Dict[str, Any]
|
annotation and return statements. |
Source code in app.py
run_vector_store_create_batch ¶
Run vector store create batch.
Purpose
Runs the vector store create batch workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
store_id
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the run_vector_store_create_batch helper according to its function |
Dict[str, Any]
|
annotation and return statements. |
Source code in app.py
run_vector_store_retrieve_batch ¶
Run vector store retrieve batch.
Purpose
Runs the vector store retrieve batch workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
store_id
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the run_vector_store_retrieve_batch helper according to its function |
Dict[str, Any]
|
annotation and return statements. |
Source code in app.py
run_vector_store_cancel_batch ¶
Run vector store cancel batch.
Purpose
Runs the vector store cancel batch workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
store_id
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the run_vector_store_cancel_batch helper according to its function |
Dict[str, Any]
|
annotation and return statements. |
Source code in app.py
run_vector_store_search ¶
Run vector store search.
Purpose
Runs the vector store search workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
store_id
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
Value produced by the run_vector_store_search helper according to its function |
List[Dict[str, Any]]
|
annotation and return statements. |
Source code in app.py
run_vector_store_answer ¶
run_vector_store_answer(
vector: VectorStores,
store_id: str | None,
prompt: str | None,
) -> str | None
Run vector store answer.
Purpose
Runs the vector store answer workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector
|
VectorStores
|
Value supplied to the helper. |
required |
store_id
|
str | None
|
Value supplied to the helper. |
required |
prompt
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Value produced by the run_vector_store_answer helper according to its function |
str | None
|
annotation and return statements. |
Source code in app.py
initialize_database ¶
Initialize the application database.
Purpose
Creates the Gipity application tables and ensures that the Prompts table uses the authoritative ID, Title, Name, Category, and Text schema. Existing compatible prompt records are preserved when a legacy Prompts schema must be migrated.
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
The function creates or updates persistent SQLite database structures. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when database initialization or Prompts-table migration fails. |
Source code in app.py
5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 | |
create_connection ¶
Create connection.
Purpose
Creates the connection resource used by the application and returns the resulting metadata or connection object when applicable.
Returns:
| Type | Description |
|---|---|
Connection
|
Value produced by the create_connection helper according to its function annotation and |
Connection
|
return statements. |
Source code in app.py
list_tables ¶
List tables.
Purpose
Provides the list tables helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the list_tables helper according to its function annotation and return |
List[str]
|
statements. |
Source code in app.py
create_schema ¶
Create schema.
Purpose
Creates the schema resource used by the application and returns the resulting metadata or connection object when applicable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[Tuple]
|
Value produced by the create_schema helper according to its function annotation and |
List[Tuple]
|
return statements. |
Source code in app.py
read_table ¶
Read table.
Purpose
Provides the read table helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
Value supplied to the helper. |
required |
limit
|
int
|
Value supplied to the helper. |
None
|
offset
|
int
|
Value supplied to the helper. |
0
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Value produced by the read_table helper according to its function annotation and return |
DataFrame
|
statements. |
Source code in app.py
6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 | |
render_table ¶
Render table.
Purpose
Renders the table user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
Value supplied to the helper. |
required |
Source code in app.py
make_display_safe ¶
Make display safe.
Purpose
Provides the make display safe helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Value produced by the make_display_safe helper according to its function annotation and |
DataFrame
|
return statements. |
Source code in app.py
drop_table ¶
Drop table.
Purpose
Deletes or removes the table resource requested by the caller while preserving safe guard checks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
Value supplied to the helper. |
required |
Source code in app.py
create_index ¶
Create index.
Purpose
Creates the index resource used by the application and returns the resulting metadata or connection object when applicable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
Value supplied to the helper. |
required |
column
|
str
|
Value supplied to the helper. |
required |
Raises:
| Type | Description |
|---|---|
Error
|
Re-raised after the exception is wrapped and written to the application logger. |
Source code in app.py
apply_filters ¶
Apply filters.
Purpose
Provides the apply filters helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Value produced by the apply_filters helper according to its function annotation and |
DataFrame
|
return statements. |
Source code in app.py
create_aggregation ¶
Create aggregation.
Purpose
Creates the aggregation resource used by the application and returns the resulting metadata or connection object when applicable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
Value supplied to the helper. |
required |
Source code in app.py
create_visualization ¶
Create visualization.
Purpose
Creates the visualization resource used by the application and returns the resulting metadata or connection object when applicable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
Value supplied to the helper. |
required |
Source code in app.py
6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 | |
convert_dataframe ¶
Convert dataframe.
Purpose
Provides the convert dataframe helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table_name
|
str
|
Value supplied to the helper. |
required |
df
|
DataFrame
|
Value supplied to the helper. |
required |
Source code in app.py
get_sqlite_type ¶
Get sqlite type.
Purpose
Returns the sqlite type value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dtype
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the get_sqlite_type helper according to its function annotation and |
str
|
return statements. |
Source code in app.py
create_custom_table ¶
Create custom table.
Purpose
Creates the custom table resource used by the application and returns the resulting metadata or connection object when applicable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table_name
|
str
|
Value supplied to the helper. |
required |
columns
|
list
|
Value supplied to the helper. |
required |
Raises:
| Type | Description |
|---|---|
Error
|
Re-raised after the exception is wrapped and written to the application logger. |
Source code in app.py
is_safe_query ¶
Is safe query.
Purpose
Provides the is safe query helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Value produced by the is_safe_query helper according to its function annotation and |
bool
|
return statements. |
Source code in app.py
create_identifier ¶
Create identifier.
Purpose
Creates the identifier resource used by the application and returns the resulting metadata or connection object when applicable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the create_identifier helper according to its function annotation and |
str
|
return statements. |
Raises:
| Type | Description |
|---|---|
Error
|
Re-raised after the exception is wrapped and written to the application logger. |
Source code in app.py
get_indexes ¶
Get indexes.
Purpose
Returns the indexes value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[Any]
|
Value produced by the get_indexes helper according to its function annotation and return |
List[Any]
|
statements. |
Source code in app.py
add_column ¶
Add column.
Purpose
Provides the add column helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
Value supplied to the helper. |
required |
column
|
str
|
Value supplied to the helper. |
required |
col_type
|
str
|
Value supplied to the helper. |
required |
Source code in app.py
rename_column ¶
Rename column.
Purpose
Provides the rename column helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table_name
|
str
|
Value supplied to the helper. |
required |
old_name
|
str
|
Value supplied to the helper. |
required |
new_name
|
str
|
Value supplied to the helper. |
required |
Raises:
| Type | Description |
|---|---|
Error
|
Re-raised after the exception is wrapped and written to the application logger. |
Source code in app.py
6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 | |
create_profile_table ¶
Create profile table.
Purpose
Creates the profile table resource used by the application and returns the resulting metadata or connection object when applicable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the create_profile_table helper according to its function annotation |
str
|
and return statements. |
Source code in app.py
drop_column ¶
Drop column.
Purpose
Deletes or removes the column resource requested by the caller while preserving safe guard checks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
Value supplied to the helper. |
required |
column
|
str
|
Value supplied to the helper. |
required |
Raises:
| Type | Description |
|---|---|
Error
|
Re-raised after the exception is wrapped and written to the application logger. |
Source code in app.py
rename_table ¶
Rename table.
Purpose
Provides the rename table helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
old_name
|
str
|
Value supplied to the helper. |
required |
new_name
|
str
|
Value supplied to the helper. |
required |
Raises:
| Type | Description |
|---|---|
Error
|
Re-raised after the exception is wrapped and written to the application logger. |
Source code in app.py
fetch_prompt_records ¶
fetch_prompt_records(
db_path: str, categories: Optional[List[str]] = None
) -> List[Dict[str, Any]]
Retrieve prompt records.
Purpose
Reads prompt records from the authoritative Prompts table. Optional category filtering restricts the returned records while preserving stable integer prompt identifiers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_path
|
str
|
Path to the application SQLite database. |
required |
categories
|
Optional[List[str]]
|
Categories used to restrict the returned records. |
None
|
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List[Dict[str, Any]]: Prompt records containing ID, Title, Name, Category, and Text. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when prompt records cannot be retrieved. |
Source code in app.py
7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 | |
fetch_prompt_categories ¶
Retrieve prompt categories.
Purpose
Returns the distinct nonempty prompt categories stored in the authoritative Prompts table for use by category selectors and Prompt Engineering filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_path
|
str
|
Path to the application SQLite database. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: Distinct prompt categories ordered without regard to case. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when prompt categories cannot be retrieved. |
Source code in app.py
fetch_prompts_by_category ¶
Retrieve prompts for one category.
Purpose
Returns prompt records assigned to the selected category. Category comparison is case-insensitive and ignores surrounding whitespace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_path
|
str
|
Path to the application SQLite database. |
required |
category
|
str
|
Prompt category used to restrict the returned records. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List[Dict[str, Any]]: Matching prompt records ordered by Title, Name, and ID. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when prompts cannot be retrieved for the selected category. |
Source code in app.py
fetch_prompt_titles ¶
fetch_prompt_titles(
db_path: str, categories: Optional[List[str]] = None
) -> List[Tuple[int, str]]
Retrieve prompt identifiers and display titles.
Purpose
Returns stable integer prompt identifiers paired with user-facing labels. Title is used first, followed by Name and then a generated ID label.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_path
|
str
|
Path to the application SQLite database. |
required |
categories
|
Optional[List[str]]
|
Categories used to restrict the returned prompts. |
None
|
Returns:
| Type | Description |
|---|---|
List[Tuple[int, str]]
|
List[Tuple[int, str]]: Prompt identifiers paired with display labels. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when prompt identifiers and titles cannot be retrieved. |
Source code in app.py
fetch_prompt_names ¶
Retrieve user-facing prompt titles.
Purpose
Preserves compatibility with the current legacy System Instructions selectors while reading Title values from the authoritative Prompts schema.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_path
|
str
|
Path to the application SQLite database. |
required |
categories
|
Optional[List[str]]
|
Categories used to restrict the returned prompts. |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: Nonempty user-facing prompt titles. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when prompt titles cannot be retrieved. |
Source code in app.py
fetch_prompt_text ¶
Retrieve prompt text.
Purpose
Retrieves prompt text by stable integer ID while retaining temporary compatibility with existing selectors that submit a Title or Name string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_path
|
str
|
Path to the application SQLite database. |
required |
prompt_reference
|
Any
|
Prompt ID, Title, or Name used to locate the record. |
required |
Returns:
| Type | Description |
|---|---|
Optional[str]
|
Optional[str]: Prompt text when a matching record exists; otherwise, None. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when prompt text cannot be retrieved. |
Source code in app.py
7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 | |
fetch_prompts_df ¶
Retrieve prompts as a DataFrame.
Purpose
Returns all prompt records using the authoritative Prompts schema and adds the Boolean selection column used by the Prompt Engineering interface.
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: Prompt records containing Selected, ID, Title, Name, Category, and Text. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when the prompt DataFrame cannot be created. |
Source code in app.py
fetch_prompt_by_id ¶
Retrieve one prompt by ID.
Purpose
Reads one prompt record using its stable integer primary-key identifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prompt_id
|
int
|
Prompt primary-key identifier. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
Optional[Dict[str, Any]]: Prompt record when found; otherwise, None. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when the prompt record cannot be retrieved. |
Source code in app.py
fetch_prompt_by_name ¶
Retrieve one prompt by Title or Name.
Purpose
Preserves temporary compatibility with legacy Gipity callers that identify prompts using display text instead of the stable integer primary key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Prompt Title or Name used to locate the record. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
Optional[Dict[str, Any]]: First matching prompt record; otherwise, None. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when the prompt record cannot be retrieved. |
Source code in app.py
7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 | |
insert_prompt ¶
Insert a prompt record.
Purpose
Creates a prompt using the authoritative Title, Name, Category, and Text fields and returns the generated integer primary-key identifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Dict[str, Any]
|
Prompt values containing Title, Name, Category, and Text. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
Integer ID assigned to the inserted prompt record. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when the prompt record cannot be inserted. |
Source code in app.py
update_prompt ¶
Update a prompt record.
Purpose
Updates the authoritative Title, Name, Category, and Text values for one prompt identified by its stable integer primary key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prompt_id
|
int
|
Prompt primary-key identifier. |
required |
data
|
Dict[str, Any]
|
Updated Title, Name, Category, and Text values. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
The function updates the persistent prompt record. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when the prompt record cannot be updated. |
Source code in app.py
delete_prompt ¶
Delete a prompt record.
Purpose
Removes one prompt from the authoritative Prompts table using its stable integer primary-key identifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prompt_id
|
int
|
Prompt primary-key identifier. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
The function removes the persistent prompt record. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when the prompt record cannot be deleted. |
Source code in app.py
format_prompt_option ¶
Format a prompt selector option.
Purpose
Converts a stable prompt identifier into its user-facing Title. Name and the prompt identifier are used as fallbacks when Title is empty.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prompt_id
|
int
|
Prompt primary-key identifier. |
required |
prompt_lookup
|
Dict[int, Dict[str, Any]]
|
Prompt records indexed by integer ID. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
User-facing prompt selector label. |
Source code in app.py
normalize_prompt_category ¶
Normalize a prompt category.
Purpose
Converts a prompt category into a stable comparison value by removing surrounding whitespace, collapsing internal whitespace, normalizing ampersands, and converting text to lowercase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
category
|
str
|
Prompt category to normalize. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Normalized prompt-category value. |
Source code in app.py
get_prompt_category_aliases ¶
Return accepted aliases for a prompt category.
Purpose
Provides explicit normalized aliases for known category-label variations without permitting unrestricted substring matching between unrelated categories.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
category
|
str
|
Canonical prompt category. |
required |
Returns:
| Type | Description |
|---|---|
Tuple[str, ...]
|
Tuple[str, ...]: Normalized canonical category and recognized aliases. |
Source code in app.py
7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 | |
prompt_category_matches_policy ¶
Determine whether a prompt category is allowed.
Purpose
Compares a database category with the canonical categories permitted by one Gipity mode. Matching uses normalized exact values and explicit aliases only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
category
|
str
|
Database prompt category. |
required |
allowed_categories
|
Tuple[str, ...]
|
Categories permitted by the current mode. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True when the database category is permitted; otherwise, False. |
Source code in app.py
filter_prompt_categories ¶
filter_prompt_categories(
available_categories: List[str],
allowed_categories: Tuple[str, ...],
) -> List[str]
Filter prompt categories for one mode.
Purpose
Restricts database categories to those allowed by the current mode while preserving their exact database labels and stable display order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
available_categories
|
List[str]
|
Categories read from the Prompts table. |
required |
allowed_categories
|
Tuple[str, ...]
|
Categories permitted by the current mode. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: Allowed database categories ordered according to the mode policy. |
Source code in app.py
load_prompt_into_state ¶
Load a selected prompt into session state.
Purpose
Retrieves the prompt selected through a mode-specific prompt selector and copies its Text value into the corresponding editable system-instruction control.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prompt_id_key
|
str
|
Session-state key containing the selected prompt ID. |
required |
instruction_key
|
str
|
Session-state key receiving the selected prompt text. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
The function updates Streamlit session state. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when the supplied state keys are invalid or the selected prompt cannot be retrieved. |
Source code in app.py
clear_prompt_state ¶
Clear one mode's system-prompt state.
Purpose
Clears the selected category, selected prompt ID, and editable instruction text for one application mode without modifying any record in the Prompts table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
category_key
|
str
|
Session-state key containing the selected prompt category. |
required |
prompt_id_key
|
str
|
Session-state key containing the selected prompt ID. |
required |
instruction_key
|
str
|
Session-state key containing the editable instruction text. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
The function updates Streamlit session state. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when the supplied state keys are invalid or cannot be cleared. |
Source code in app.py
convert_prompt_state ¶
Convert mode-specific system instructions.
Purpose
Converts the specified instruction value between supported XML prompt blocks and Markdown or HTML heading notation using Gipity's existing conversion helpers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instruction_key
|
str
|
Session-state key containing the editable instruction text. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
The function updates Streamlit session state. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when the supplied state key is invalid or the instruction text cannot be converted. |
Source code in app.py
render_system_prompt_expander ¶
render_system_prompt_expander(
state_prefix: str,
instruction_key: str,
allowed_categories: Tuple[str, ...],
label: str = "System Instructions",
height: int = 135,
) -> None
Render a category-driven system-instruction expander.
Purpose
Renders a reusable System Instructions interface containing an editable instruction area, mode-filtered category selector, prompt selector, clear control, and XML or Markdown conversion control. Prompt selection uses the stable integer ID stored in the authoritative Prompts table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state_prefix
|
str
|
Prefix used to construct mode-specific widget and state keys. |
required |
instruction_key
|
str
|
Session-state key containing the editable instruction text. |
required |
allowed_categories
|
Tuple[str, ...]
|
Canonical prompt categories permitted by the current application mode. |
required |
label
|
str
|
Text displayed in the Streamlit expander header. |
'System Instructions'
|
height
|
int
|
Height of the editable instruction text area in pixels. |
135
|
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
The function renders Streamlit controls and updates session state. |
Raises:
| Type | Description |
|---|---|
Error
|
Raised when prompt data cannot be retrieved or the expander cannot be rendered. |
Source code in app.py
7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 | |
build_prompt ¶
Build prompt.
Purpose
Builds the prompt value used by the Gipity interface or provider wrapper. The function normalizes inputs and returns a stable object for downstream use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_input
|
str
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the build_prompt helper according to its function annotation and |
str
|
return statements. |
Source code in app.py
reset_audio_model_controls ¶
Reset audio model controls.
Purpose
Resets the audio model controls state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
reset_audio_inference_controls ¶
Reset audio inference controls.
Purpose
Resets the audio inference controls state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
reset_audio_sound_controls ¶
Reset audio sound controls.
Purpose
Resets the audio sound controls state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
ensure_audio_mode_state ¶
Ensure audio mode state.
Purpose
Ensures the required audio mode state session-state keys or runtime resources exist before the related interface controls are rendered.
Source code in app.py
get_audio_task_options ¶
Get audio task options.
Purpose
Returns the audio task options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_audio_task_options helper according to its function annotation |
List[str]
|
and return statements. |
Source code in app.py
get_audio_model_options ¶
get_audio_model_options(
task: str | None,
transcriber: Transcription,
translator: Translation,
tts: TTS,
) -> List[str]
Get audio model options.
Purpose
Returns the audio model options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
str | None
|
Value supplied to the helper. |
required |
transcriber
|
Transcription
|
Value supplied to the helper. |
required |
translator
|
Translation
|
Value supplied to the helper. |
required |
tts
|
TTS
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_audio_model_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_audio_language_options ¶
Get audio language options.
Purpose
Returns the audio language options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transcriber
|
Transcription
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_audio_language_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_audio_voice_options ¶
Get audio voice options.
Purpose
Returns the text-to-speech voices supported by the selected OpenAI speech model. The function prevents voices available only to GPT-4o Mini TTS from being submitted to the legacy TTS models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tts
|
TTS
|
Text-to-speech wrapper exposing the complete voice option collection. |
required |
model
|
str
|
Selected OpenAI text-to-speech model identifier. |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
List[ str ]: Model-compatible voice options with an empty selector option. |
Source code in app.py
get_audio_speed_options ¶
Get audio speed options.
Purpose
Returns the audio speed options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tts
|
TTS
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[float]
|
Value produced by the get_audio_speed_options helper according to its function |
List[float]
|
annotation and return statements. |
Source code in app.py
get_audio_response_format_options ¶
get_audio_response_format_options(
task: str | None,
model: str | None,
transcriber: Transcription,
translator: Translation,
tts: TTS,
) -> List[str]
Get audio response format options.
Purpose
Returns the audio response format options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
str | None
|
Value supplied to the helper. |
required |
model
|
str | None
|
Value supplied to the helper. |
required |
transcriber
|
Transcription
|
Value supplied to the helper. |
required |
translator
|
Translation
|
Value supplied to the helper. |
required |
tts
|
TTS
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_audio_response_format_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_audio_include_options ¶
get_audio_include_options(
task: str | None,
model: str | None,
transcriber: Transcription,
) -> List[str]
Get audio include options.
Purpose
Returns the audio include options value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
str | None
|
Value supplied to the helper. |
required |
model
|
str | None
|
Value supplied to the helper. |
required |
transcriber
|
Transcription
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Value produced by the get_audio_include_options helper according to its function |
List[str]
|
annotation and return statements. |
Source code in app.py
get_audio_response_format_value ¶
get_audio_response_format_value(
task: str | None,
selected_format: str | None,
selected_mime_type: str | None = None,
) -> str | None
Get audio response format value.
Purpose
Returns the audio response format value value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
str | None
|
Value supplied to the helper. |
required |
selected_format
|
str | None
|
Value supplied to the helper. |
required |
selected_mime_type
|
str | None
|
Value supplied to the helper. |
None
|
Returns:
| Type | Description |
|---|---|
str | None
|
Value produced by the get_audio_response_format_value helper according to its function |
str | None
|
annotation and return statements. |
Source code in app.py
get_audio_prompt_value ¶
Get audio prompt value.
Purpose
Returns the audio prompt value value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
str | None
|
Value supplied to the helper. |
required |
prompt
|
str | None
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Value produced by the get_audio_prompt_value helper according to its function annotation |
str | None
|
and return statements. |
Source code in app.py
save_audio_upload ¶
Save audio upload.
Purpose
Saves the audio upload value for later workflow use while preserving the caller-facing return contract.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
upload
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Value produced by the save_audio_upload helper according to its function annotation and |
str | None
|
return statements. |
Source code in app.py
render_audio_segments ¶
Render audio segments.
Purpose
Renders the audio segments user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
Dict[str, Any] | None
|
Value supplied to the helper. |
required |
Source code in app.py
render_audio_text_result ¶
render_audio_text_result(
title: str,
result_text: str | None,
result: Dict[str, Any] | None = None,
) -> None
Render audio text result.
Purpose
Renders the audio text result user-interface section or display element in Streamlit while preserving the application state expected by the surrounding workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Value supplied to the helper. |
required |
result_text
|
str | None
|
Value supplied to the helper. |
required |
result
|
Dict[str, Any] | None
|
Value supplied to the helper. |
None
|
Source code in app.py
extract_audio_usage ¶
Extract audio usage.
Purpose
Extracts the audio usage value from the supplied object or payload while handling missing or unsupported content safely.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
Any
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Value produced by the extract_audio_usage helper according to its function annotation |
Dict[str, Any]
|
and return statements. |
Source code in app.py
run_audio_file_task ¶
run_audio_file_task(
task: str | None,
file_path: str | None,
transcriber: Transcription,
translator: Translation,
) -> str | None
Run audio file task.
Purpose
Runs the audio file task workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
str | None
|
Value supplied to the helper. |
required |
file_path
|
str | None
|
Value supplied to the helper. |
required |
transcriber
|
Transcription
|
Value supplied to the helper. |
required |
translator
|
Translation
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Value produced by the run_audio_file_task helper according to its function annotation |
str | None
|
and return statements. |
Source code in app.py
run_audio_tts_task ¶
Run audio tts task.
Purpose
Runs the audio tts task workflow from the Streamlit interface by validating current inputs, calling the appropriate wrapper or helper, and storing relevant output state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str | None
|
Value supplied to the helper. |
required |
tts
|
TTS
|
Value supplied to the helper. |
required |
Returns:
| Type | Description |
|---|---|
bytes | None
|
Value produced by the run_audio_tts_task helper according to its function annotation and |
bytes | None
|
return statements. |
Source code in app.py
clear_audio_outputs ¶
Clear audio outputs.
Purpose
Clears the audio outputs state used by the current workflow so the user interface can start from a clean output state.
Source code in app.py
clear_audio_messages ¶
Clear audio messages.
Purpose
Clears the audio messages state used by the current workflow so the user interface can start from a clean output state.
Source code in app.py
clear_audio_instructions ¶
Clear audio instructions.
Purpose
Clears the audio instructions state used by the current workflow so the user interface can start from a clean output state.
Source code in app.py
load_audio_instruction_template ¶
Load audio instruction template.
Purpose
Loads the audio instruction template resource or state required by the Gipity workflow and returns the prepared value for caller use.
Source code in app.py
convert_audio_system_instructions ¶
Convert audio system instructions.
Purpose
Provides the convert audio system instructions helper used by the Gipity Streamlit application. The function supports UI state management, provider coordination, data normalization, or display behavior required by the surrounding workflow.
Source code in app.py
reset_audio_task_controls ¶
Reset audio task controls.
Purpose
Resets the audio task controls state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
reset_audio_tts_controls ¶
Reset audio tts controls.
Purpose
Resets the audio tts controls state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
reset_text_llm_controls ¶
Reset text llm controls.
Purpose
Resets the text llm controls state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
reset_text_tool_controls ¶
Reset text tool controls.
Purpose
Resets the text tool controls state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
reset_text_response_controls ¶
Reset text response controls.
Purpose
Resets the Text mode response-control state without modifying model, tool, prompt-template, conversation-message, or database state.
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
The function removes the response-control keys from Streamlit session state. |
Source code in app.py
clear_files_current_selection ¶
Clear the current Files API selection.
Purpose
Clears the selected file and its file-specific outputs without deleting the remote file or clearing the current Files API listing.
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
This function updates Files mode selection and output state. |
Source code in app.py
reset_files_workspace ¶
Reset the complete Files API workspace.
Purpose
Clears Files mode controls, file listings, current selection, outputs, and messages while leaving remote OpenAI files unchanged.
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
This function resets Files mode session state. |
Source code in app.py
get_conn ¶
Get conn.
Purpose
Returns the conn value used by the Gipity interface. The helper centralizes option lookup and fallback behavior for callers.
Returns:
| Type | Description |
|---|---|
str
|
Value produced by the get_conn helper according to its function annotation |
str
|
and return |
str
|
statements. |
Source code in app.py
reset_selection ¶
Reset selection.
Purpose
Resets the selection state used by the application. The function clears related Streamlit keys without performing provider calls.
Source code in app.py
load_prompt ¶
Load prompt.
Purpose
Loads the prompt resource or state required by the Gipity workflow and returns the prepared value for caller use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pid
|
int
|
Value supplied to the helper. |
required |