Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Azure-Samples/rag-postgres-openai-python
/ functions
Functions
182 in github.com/Azure-Samples/rag-postgres-openai-python
⨍
Functions
182
◇
Types & classes
47
↳
Endpoints
5
Function
free_port
Returns a free port for the test server to bind.
tests/e2e.py:32
Method
get_aggregate_stats
(cls, df)
evals/evaluate.py:37
Function
get_async_db_session
( sessionmaker: Annotated[async_sessionmaker[AsyncSession], Depends(get_async_sessionmaker)], )
src/backend/fastapi_app/dependencies.py:126
Function
get_async_sessionmaker
( request: Request, )
src/backend/fastapi_app/dependencies.py:114
Function
get_context
( request: Request, )
src/backend/fastapi_app/dependencies.py:120
Function
get_openai_chat_client
Get the OpenAI chat client
src/backend/fastapi_app/dependencies.py:133
Function
get_openai_embed_client
Get the OpenAI embed client
src/backend/fastapi_app/dependencies.py:140
Method
get_token
( self, *scopes: str, claims: Optional[str] = None, tenant_id: Optional[str] =
tests/mocks.py:22
Function
handle
(route: Route)
tests/e2e.py:61
Function
index
(request)
src/backend/fastapi_app/routes/frontend_routes.py:10
Function
item_handler
A simple API to get an item by ID.
src/backend/fastapi_app/routes/api_routes.py:48
Function
lifespan
(app: fastapi.FastAPI)
src/backend/fastapi_app/__init__.py:35
Function
live_server_url
(mock_session_env, free_port: int)
tests/e2e.py:45
Function
mock_acreate
(*args, **kwargs)
tests/conftest.py:155
Function
mock_azure_credential
Mock the Azure credential for testing.
tests/conftest.py:346
Function
mock_openai_chatcompletion
(monkeypatch_session)
tests/conftest.py:175
Function
mock_openai_embedding
(monkeypatch_session)
tests/conftest.py:154
Function
mock_session_env
Mock the environment variables for testing.
tests/conftest.py:50
Function
mock_session_env_ollama
Mock the environment variables for testing.
tests/conftest.py:109
Function
mock_session_env_openai
Mock the environment variables for testing.
tests/conftest.py:81
Function
monkeypatch_session
()
tests/conftest.py:44
Function
onEnterPress
(ev: React.KeyboardEvent<Element>)
src/frontend/src/components/QuestionInput/QuestionInput.tsx:35
Function
onExampleClicked
(example: string)
src/frontend/src/pages/chat/Chat.tsx:176
Function
onPromptTemplateChange
(_ev?: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string)
src/frontend/src/pages/chat/Chat.tsx:152
Function
onQuestionChange
(_ev: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string)
src/frontend/src/components/QuestionInput/QuestionInput.tsx:42
Function
onRetrievalModeChange
(_ev: React.FormEvent<HTMLDivElement>, option?: IDropdownOption<RetrievalMode> | undefined)
src/frontend/src/components/VectorSettings/VectorSettings.tsx:14
Function
onRetrieveCountChange
(_ev?: React.SyntheticEvent<HTMLElement, Event>, newValue?: string)
src/frontend/src/pages/chat/Chat.tsx:164
Function
onShouldStreamChange
(_ev?: React.FormEvent<HTMLElement | HTMLInputElement>, checked?: boolean)
src/frontend/src/pages/chat/Chat.tsx:172
Function
onTemperatureChange
( newValue: number, range?: [number, number], event?: React.MouseEvent | React.TouchEv
src/frontend/src/pages/chat/Chat.tsx:156
Function
onUseAdvancedFlowChange
(_ev?: React.FormEvent<HTMLElement | HTMLInputElement>, checked?: boolean)
src/frontend/src/pages/chat/Chat.tsx:168
Function
postgres_searcher
(mock_session_env, mock_azure_credential, db_session, mock_openai_embedding)
tests/conftest.py:374
Method
prepare_context
(self)
src/backend/fastapi_app/rag_base.py:46
Method
prepare_context
(self)
src/backend/fastapi_app/rag_advanced.py:110
Function
register_custom_types
(dbapi_connection: AdaptedConnection, *args)
src/backend/fastapi_app/postgres_engine.py:39
Function
renderFileViewer
()
src/frontend/src/components/AnalysisPanel/AnalysisPanel.tsx:51
Function
run_server
(port: int)
tests/e2e.py:40
Method
search_database
Search PostgreSQL database for relevant products based on user query Args: search_query: English query string to use for
src/backend/fastapi_app/rag_advanced.py:76
Function
search_handler
A search API to find items based on a query.
src/backend/fastapi_app/routes/api_routes.py:80
Function
similar_handler
A similarity API to find items similar to items with given ID.
src/backend/fastapi_app/routes/api_routes.py:57
Function
source_to_text
(source)
evals/generate_ground_truth.py:68
Function
test_advanced_chat_flow
test the advanced chat flow route with hybrid retrieval mode
tests/test_api_routes.py:170
Function
test_advanced_chat_streaming_flow
test the advanced chat streaming flow route with hybrid retrieval mode
tests/test_api_routes.py:189
Function
test_assets
test the assets route with an existing file
tests/test_frontend_routes.py:47
Function
test_assets_non_existent_404
test the assets route with a non-existent file
tests/test_frontend_routes.py:36
Function
test_chat
(page: Page, live_server_url: str)
tests/e2e.py:59
Function
test_chat_customization
(page: Page, live_server_url: str)
tests/e2e.py:102
Function
test_chat_non_json_422
test the chat route with a non-json request
tests/test_api_routes.py:207
Function
test_chat_nonstreaming
(page: Page, live_server_url: str)
tests/e2e.py:151
Function
test_client
Create a test client.
tests/conftest.py:354
Function
test_compute_text_embedding
(mock_azure_credential, mock_openai_embedding)
tests/test_embeddings.py:9
Function
test_compute_text_embedding_dimensions
(mock_azure_credential, mock_openai_embedding)
tests/test_embeddings.py:21
Function
test_create_openai_chat_client
(mock_azure_credential, mock_openai_chatcompletion)
tests/test_openai_clients.py:18
Function
test_create_openai_embed_client
(mock_azure_credential, mock_openai_embedding)
tests/test_openai_clients.py:8
Function
test_create_postgres_engine
(mock_session_env, mock_azure_credential)
tests/test_postgres_engine.py:14
Function
test_create_postgres_engine_from_args
(mock_azure_credential)
tests/test_postgres_engine.py:43
Function
test_create_postgres_engine_from_env
(mock_session_env, mock_azure_credential)
tests/test_postgres_engine.py:31
Function
test_favicon
test the favicon route
tests/test_frontend_routes.py:22
Function
test_get_azure_credential
(mock_session_env, mock_azure_credential)
tests/test_dependencies.py:37
Function
test_get_common_parameters
(mock_session_env)
tests/test_dependencies.py:7
Function
test_get_common_parameters_ollama
(mock_session_env_ollama)
tests/test_dependencies.py:17
Function
test_get_common_parameters_openai
(mock_session_env_openai)
tests/test_dependencies.py:27
Function
test_home
(page: Page, live_server_url: str)
tests/e2e.py:54
Function
test_index
test the index route
tests/test_frontend_routes.py:7
Function
test_item_handler
test the item_handler route
tests/test_api_routes.py:9
Function
test_item_handler_404
test the item_handler route with a non-existent item
tests/test_api_routes.py:25
Function
test_postgres_build_filter_clause_with_filters
(postgres_searcher)
tests/test_postgres_searcher.py:12
Function
test_postgres_build_filter_clause_with_filters_numeric
(postgres_searcher)
tests/test_postgres_searcher.py:23
Function
test_postgres_build_filter_clause_without_filters
(postgres_searcher)
tests/test_postgres_searcher.py:7
Function
test_postgres_searcher_search
(postgres_searcher)
tests/test_postgres_searcher.py:40
Function
test_postgres_searcher_search_and_embed
(postgres_searcher)
tests/test_postgres_searcher.py:52
Function
test_postgres_searcher_search_and_embed_empty_text_search
(postgres_searcher)
tests/test_postgres_searcher.py:47
Function
test_postgres_searcher_search_empty_text_search
(postgres_searcher)
tests/test_postgres_searcher.py:35
Function
test_search_handler
test the search_handler route
tests/test_api_routes.py:83
Function
test_search_handler_422
test the search_handler route with missing query parameters
tests/test_api_routes.py:99
Function
test_similar_handler
test the similar_handler route
tests/test_api_routes.py:37
Function
test_similar_handler_404
test the similar_handler route with a non-existent item
tests/test_api_routes.py:71
Function
test_similar_handler_422
test the similar_handler route with missing query parameters
tests/test_api_routes.py:60
Function
test_simple_chat_flow
test the simple chat flow route with hybrid retrieval mode
tests/test_api_routes.py:110
Function
test_simple_chat_flow_message_history
test the simple chat flow route with hybrid retrieval mode
tests/test_api_routes.py:129
Function
test_simple_chat_streaming_flow
test the simple chat streaming flow route with hybrid retrieval mode
tests/test_api_routes.py:152
Method
to_str_for_rag
(self)
src/backend/fastapi_app/api_models.py:39
Function
update_password_token
(dialect, conn_rec, cargs, cparams)
src/backend/fastapi_app/postgres_engine.py:47
← previous
101–182 of 182, ranked by callers