Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Safiullah-Rahu/CSV-AI
/ functions
Functions
107 in github.com/Safiullah-Rahu/CSV-AI
⨍
Functions
107
◇
Types & classes
17
↓ 7 callers
Function
build_provider
Construct an :class:`LLMProvider`. Falls back to :class:`Settings` defaults for any value not supplied, and resolves the API key from setting
app/llm/factory.py:65
↓ 7 callers
Function
profile_dataframe
Compute summary statistics for ``df``. ``sample_size`` controls how many example values we capture per column — useful for showing the LLM wh
app/data/profiler.py:71
↓ 6 callers
Function
load_csv
Load a CSV from a path, bytes, or file-like object. Raises :class:`DataError` on failure with a readable message. Never silently swallows dec
app/data/loader.py:77
↓ 5 callers
Function
_safe_float
(value: Any)
app/data/profiler.py:62
↓ 5 callers
Function
get_logger
Return a namespaced logger under ``csvai.<name>``.
app/utils/logging.py:34
↓ 4 callers
Function
_fake_settings
(**overrides)
tests/test_llm_factory.py:23
↓ 4 callers
Function
available_models
Return suggested models for ``provider``. Custom names are allowed.
app/llm/factory.py:60
↓ 4 callers
Function
available_providers
Return the list of registered provider names.
app/llm/factory.py:55
↓ 4 callers
Function
build_dataframe_context
Return a markdown string describing ``df`` for prompt injection.
app/data/context.py:42
↓ 3 callers
Method
_normalize
(messages: Iterable[Message])
app/llm/base.py:81
↓ 3 callers
Method
_split_system
(messages: Iterable[Message])
app/llm/anthropic_provider.py:63
↓ 3 callers
Method
complete
Return a single, fully-formed response.
app/llm/base.py:72
↓ 3 callers
Function
get_provider_config
Return (provider, model, temperature, max_tokens, api_key, base_url).
app/ui/components/sidebar.py:154
↓ 3 callers
Function
render_preview
Render an expandable preview with key metrics + the head of the frame.
app/ui/components/data_preview.py:10
↓ 3 callers
Function
require_dataset
Return the loaded dataset or render an info message and ``None``.
app/ui/components/sidebar.py:145
↓ 3 callers
Function
run
()
app/main.py:33
↓ 3 callers
Function
smart_sample
Return up to ``n`` rows, stratified when possible.
app/data/sampler.py:13
↓ 3 callers
Function
stream_assistant
Render an assistant message that updates as tokens stream in. Returns the assembled text so the caller can persist it to history.
app/ui/components/chat_box.py:20
↓ 2 callers
Method
_build_messages
(self, history: List[Message], question: str)
app/services/chat_service.py:52
↓ 2 callers
Method
_ensure_client
(self)
app/llm/anthropic_provider.py:42
↓ 2 callers
Method
_ensure_client
(self)
app/llm/openai_provider.py:43
↓ 2 callers
Method
_ensure_requests
(self)
app/llm/ollama_provider.py:54
↓ 2 callers
Method
_messages
(self, question: str, history: List[Message])
app/services/analysis_service.py:61
↓ 2 callers
Method
_messages
(self)
app/services/summary_service.py:31
↓ 2 callers
Method
_payload
(self, messages: Iterable[Message], stream: bool)
app/llm/ollama_provider.py:43
↓ 2 callers
Function
build_user_question_prompt
Wrap a user question with a light instruction reinforcement. Keeps the user message focused and consistent across providers.
app/prompts/templates.py:68
↓ 2 callers
Function
get_settings
Return a cached :class:`Settings` instance. On Streamlit Community Cloud, ``st.secrets`` provides API keys. We try to merge them in (best-eff
app/config/settings.py:62
↓ 2 callers
Function
render_history
(history: List[Message])
app/ui/components/chat_box.py:12
↓ 1 callers
Function
_charts_view
(df: pd.DataFrame)
app/ui/components/stats_panel.py:84
↓ 1 callers
Function
_configure_root
(level: str = "INFO")
app/utils/logging.py:16
↓ 1 callers
Function
_correlation_view
(profile: DataProfile)
app/ui/components/stats_panel.py:69
↓ 1 callers
Function
_detect_delimiter
(text_sample: str)
app/data/loader.py:69
↓ 1 callers
Function
_detect_encoding
Try each candidate encoding until one decodes the first 4 KiB cleanly.
app/data/loader.py:57
↓ 1 callers
Function
_get_encoder
(model: str)
app/utils/tokens.py:15
↓ 1 callers
Function
_missing_view
(df: pd.DataFrame)
app/ui/components/stats_panel.py:50
↓ 1 callers
Function
_numeric_view
(df: pd.DataFrame)
app/ui/components/stats_panel.py:61
↓ 1 callers
Function
_read_bytes
(source: Union[str, bytes, IO[bytes]])
app/data/loader.py:37
↓ 1 callers
Function
_render_provider_section
(settings)
app/ui/components/sidebar.py:49
↓ 1 callers
Function
_render_upload_section
()
app/ui/components/sidebar.py:118
↓ 1 callers
Function
_sample_block
(df: pd.DataFrame, max_rows: int)
app/data/context.py:35
↓ 1 callers
Function
_schema_block
(profile: DataProfile)
app/data/context.py:26
↓ 1 callers
Function
_schema_view
(profile: DataProfile)
app/ui/components/stats_panel.py:34
↓ 1 callers
Function
_stratify
Group-by stratified sample, robust across pandas versions.
app/data/sampling_impl.py:39
↓ 1 callers
Function
_stratify
Group-by stratified sample, robust across pandas versions.
app/data/sampler.py:34
↓ 1 callers
Function
apply_theme
Inject the dashboard CSS. Idempotent within a session.
app/ui/theme.py:57
↓ 1 callers
Function
head_tail_sample
First + last rows for compact prompts.
app/data/sampler.py:50
↓ 1 callers
Function
init_state
Initialize every session key the app reads.
app/ui/state.py:16
↓ 1 callers
Function
render_sidebar
Render the sidebar and return the currently selected page name.
app/ui/components/sidebar.py:24
↓ 1 callers
Function
render_stats_tabs
Render a tabbed view: schema, missing, numeric, correlation, charts.
app/ui/components/stats_panel.py:11
↓ 1 callers
Function
reset_analyze
()
app/ui/state.py:39
↓ 1 callers
Function
reset_chat
()
app/ui/state.py:35
↓ 1 callers
Method
stream
( self, question: str, history: Optional[List[Message]] = None )
app/services/analysis_service.py:71
↓ 1 callers
Method
stream
Token-incremental answer. The caller is responsible for assembly.
app/services/chat_service.py:62
↓ 1 callers
Method
to_dict
(self)
app/llm/base.py:26
Method
__init__
( self, model: str, *, temperature: float = 0.2, max_tokens: int = 102
app/llm/base.py:55
Method
__init__
( self, model: str = "llama3.1", *, temperature: float = 0.2, max_toke
app/llm/ollama_provider.py:25
Method
__init__
( self, model: str = "claude-sonnet-4-5", *, temperature: float = 0.2,
app/llm/anthropic_provider.py:23
Method
__init__
( self, model: str = "gpt-4o-mini", *, temperature: float = 0.2, max_t
app/llm/openai_provider.py:24
Method
__post_init__
(self)
app/services/analysis_service.py:32
Method
__post_init__
(self)
app/services/summary_service.py:28
Method
__post_init__
(self)
app/services/chat_service.py:42
Function
append_chat
(history_key: str, role: str, content: str)
app/ui/state.py:43
Method
ask
(self, question: str, history: Optional[List[Message]] = None)
app/services/analysis_service.py:68
Method
ask
One-shot answer (non-streaming).
app/services/chat_service.py:57
Method
categorical_top_values
(self, top_n: int = 5)
app/services/analysis_service.py:50
Method
complete
(self, messages: Iterable[Message])
app/llm/ollama_provider.py:63
Method
complete
(self, messages: Iterable[Message])
app/llm/anthropic_provider.py:74
Method
complete
(self, messages: Iterable[Message])
app/llm/openai_provider.py:60
Method
correlation
(self)
app/services/analysis_service.py:57
Function
draw
(g: pd.DataFrame)
app/data/sampling_impl.py:42
Function
draw
(g: pd.DataFrame)
app/data/sampler.py:37
Function
estimate_tokens
Estimate the number of tokens for ``text``. Uses tiktoken for OpenAI-family models; otherwise approximates one token per four characters (a w
app/utils/tokens.py:27
Method
generate
(self)
app/services/summary_service.py:43
Function
head_tail_sample
Return head + tail rows for compact prompts.
app/data/sampling_impl.py:55
Method
missing_value_report
(self)
app/services/analysis_service.py:42
Method
numeric_describe
(self)
app/services/analysis_service.py:47
Function
render
()
app/ui/pages/chat.py:17
Function
render
()
app/ui/pages/analyze.py:18
Function
render
()
app/ui/pages/home.py:8
Function
render
()
app/ui/pages/summarize.py:15
Function
sample_csv_bytes
A tiny but realistic CSV with mixed dtypes and a missing value.
tests/conftest.py:12
Function
sample_df
(sample_csv_bytes: bytes)
tests/conftest.py:24
Function
smart_sample
Return at most ``n`` rows from ``df`` using stratification if possible.
app/data/sampling_impl.py:13
Method
stream
Yield incremental text chunks as the model generates.
app/llm/base.py:76
Method
stream
(self, messages: Iterable[Message])
app/llm/ollama_provider.py:86
Method
stream
(self, messages: Iterable[Message])
app/llm/anthropic_provider.py:99
Method
stream
(self, messages: Iterable[Message])
app/llm/openai_provider.py:83
Method
stream
(self)
app/services/summary_service.py:46
Function
test_accepts_filelike
()
tests/test_loader.py:40
Function
test_anthropic_splits_system_messages
()
tests/test_llm_factory.py:80
Function
test_available_models_returns_list
()
tests/test_llm_factory.py:38
Function
test_available_providers_includes_all
()
tests/test_llm_factory.py:33
Function
test_build_anthropic_provider
()
tests/test_llm_factory.py:55
Function
test_build_ollama_provider_uses_base_url
()
tests/test_llm_factory.py:65
Function
test_build_openai_provider
()
tests/test_llm_factory.py:44
Function
test_context_contains_schema_and_sample
(sample_df: pd.DataFrame)
tests/test_profiler.py:40
Function
test_loads_cp1252_with_smart_quotes
()
tests/test_loader.py:28
Function
test_loads_semicolon_delimited
()
tests/test_loader.py:21
Function
test_loads_utf8_csv
(sample_csv_bytes: bytes)
tests/test_loader.py:13
Function
test_profile_basic
(sample_df: pd.DataFrame)
tests/test_profiler.py:12
next →
1–100 of 107, ranked by callers