MCPcopy Create free account

hub / github.com/Azure-Samples/rag-postgres-openai-python / functions

Functions182 in github.com/Azure-Samples/rag-postgres-openai-python

Functionfree_port
Returns a free port for the test server to bind.
tests/e2e.py:32
Methodget_aggregate_stats
(cls, df)
evals/evaluate.py:37
Functionget_async_db_session
( sessionmaker: Annotated[async_sessionmaker[AsyncSession], Depends(get_async_sessionmaker)], )
src/backend/fastapi_app/dependencies.py:126
Functionget_async_sessionmaker
( request: Request, )
src/backend/fastapi_app/dependencies.py:114
Functionget_context
( request: Request, )
src/backend/fastapi_app/dependencies.py:120
Functionget_openai_chat_client
Get the OpenAI chat client
src/backend/fastapi_app/dependencies.py:133
Functionget_openai_embed_client
Get the OpenAI embed client
src/backend/fastapi_app/dependencies.py:140
Methodget_token
( self, *scopes: str, claims: Optional[str] = None, tenant_id: Optional[str] =
tests/mocks.py:22
Functionhandle
(route: Route)
tests/e2e.py:61
Functionindex
(request)
src/backend/fastapi_app/routes/frontend_routes.py:10
Functionitem_handler
A simple API to get an item by ID.
src/backend/fastapi_app/routes/api_routes.py:48
Functionlifespan
(app: fastapi.FastAPI)
src/backend/fastapi_app/__init__.py:35
Functionlive_server_url
(mock_session_env, free_port: int)
tests/e2e.py:45
Functionmock_acreate
(*args, **kwargs)
tests/conftest.py:155
Functionmock_azure_credential
Mock the Azure credential for testing.
tests/conftest.py:346
Functionmock_openai_chatcompletion
(monkeypatch_session)
tests/conftest.py:175
Functionmock_openai_embedding
(monkeypatch_session)
tests/conftest.py:154
Functionmock_session_env
Mock the environment variables for testing.
tests/conftest.py:50
Functionmock_session_env_ollama
Mock the environment variables for testing.
tests/conftest.py:109
Functionmock_session_env_openai
Mock the environment variables for testing.
tests/conftest.py:81
Functionmonkeypatch_session
()
tests/conftest.py:44
FunctiononEnterPress
(ev: React.KeyboardEvent<Element>)
src/frontend/src/components/QuestionInput/QuestionInput.tsx:35
FunctiononExampleClicked
(example: string)
src/frontend/src/pages/chat/Chat.tsx:176
FunctiononPromptTemplateChange
(_ev?: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string)
src/frontend/src/pages/chat/Chat.tsx:152
FunctiononQuestionChange
(_ev: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string)
src/frontend/src/components/QuestionInput/QuestionInput.tsx:42
FunctiononRetrievalModeChange
(_ev: React.FormEvent<HTMLDivElement>, option?: IDropdownOption<RetrievalMode> | undefined)
src/frontend/src/components/VectorSettings/VectorSettings.tsx:14
FunctiononRetrieveCountChange
(_ev?: React.SyntheticEvent<HTMLElement, Event>, newValue?: string)
src/frontend/src/pages/chat/Chat.tsx:164
FunctiononShouldStreamChange
(_ev?: React.FormEvent<HTMLElement | HTMLInputElement>, checked?: boolean)
src/frontend/src/pages/chat/Chat.tsx:172
FunctiononTemperatureChange
( newValue: number, range?: [number, number], event?: React.MouseEvent | React.TouchEv
src/frontend/src/pages/chat/Chat.tsx:156
FunctiononUseAdvancedFlowChange
(_ev?: React.FormEvent<HTMLElement | HTMLInputElement>, checked?: boolean)
src/frontend/src/pages/chat/Chat.tsx:168
Functionpostgres_searcher
(mock_session_env, mock_azure_credential, db_session, mock_openai_embedding)
tests/conftest.py:374
Methodprepare_context
(self)
src/backend/fastapi_app/rag_base.py:46
Methodprepare_context
(self)
src/backend/fastapi_app/rag_advanced.py:110
Functionregister_custom_types
(dbapi_connection: AdaptedConnection, *args)
src/backend/fastapi_app/postgres_engine.py:39
FunctionrenderFileViewer
()
src/frontend/src/components/AnalysisPanel/AnalysisPanel.tsx:51
Functionrun_server
(port: int)
tests/e2e.py:40
Methodsearch_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
Functionsearch_handler
A search API to find items based on a query.
src/backend/fastapi_app/routes/api_routes.py:80
Functionsimilar_handler
A similarity API to find items similar to items with given ID.
src/backend/fastapi_app/routes/api_routes.py:57
Functionsource_to_text
(source)
evals/generate_ground_truth.py:68
Functiontest_advanced_chat_flow
test the advanced chat flow route with hybrid retrieval mode
tests/test_api_routes.py:170
Functiontest_advanced_chat_streaming_flow
test the advanced chat streaming flow route with hybrid retrieval mode
tests/test_api_routes.py:189
Functiontest_assets
test the assets route with an existing file
tests/test_frontend_routes.py:47
Functiontest_assets_non_existent_404
test the assets route with a non-existent file
tests/test_frontend_routes.py:36
Functiontest_chat
(page: Page, live_server_url: str)
tests/e2e.py:59
Functiontest_chat_customization
(page: Page, live_server_url: str)
tests/e2e.py:102
Functiontest_chat_non_json_422
test the chat route with a non-json request
tests/test_api_routes.py:207
Functiontest_chat_nonstreaming
(page: Page, live_server_url: str)
tests/e2e.py:151
Functiontest_client
Create a test client.
tests/conftest.py:354
Functiontest_compute_text_embedding
(mock_azure_credential, mock_openai_embedding)
tests/test_embeddings.py:9
Functiontest_compute_text_embedding_dimensions
(mock_azure_credential, mock_openai_embedding)
tests/test_embeddings.py:21
Functiontest_create_openai_chat_client
(mock_azure_credential, mock_openai_chatcompletion)
tests/test_openai_clients.py:18
Functiontest_create_openai_embed_client
(mock_azure_credential, mock_openai_embedding)
tests/test_openai_clients.py:8
Functiontest_create_postgres_engine
(mock_session_env, mock_azure_credential)
tests/test_postgres_engine.py:14
Functiontest_create_postgres_engine_from_args
(mock_azure_credential)
tests/test_postgres_engine.py:43
Functiontest_create_postgres_engine_from_env
(mock_session_env, mock_azure_credential)
tests/test_postgres_engine.py:31
Functiontest_favicon
test the favicon route
tests/test_frontend_routes.py:22
Functiontest_get_azure_credential
(mock_session_env, mock_azure_credential)
tests/test_dependencies.py:37
Functiontest_get_common_parameters
(mock_session_env)
tests/test_dependencies.py:7
Functiontest_get_common_parameters_ollama
(mock_session_env_ollama)
tests/test_dependencies.py:17
Functiontest_get_common_parameters_openai
(mock_session_env_openai)
tests/test_dependencies.py:27
Functiontest_home
(page: Page, live_server_url: str)
tests/e2e.py:54
Functiontest_index
test the index route
tests/test_frontend_routes.py:7
Functiontest_item_handler
test the item_handler route
tests/test_api_routes.py:9
Functiontest_item_handler_404
test the item_handler route with a non-existent item
tests/test_api_routes.py:25
Functiontest_postgres_build_filter_clause_with_filters
(postgres_searcher)
tests/test_postgres_searcher.py:12
Functiontest_postgres_build_filter_clause_with_filters_numeric
(postgres_searcher)
tests/test_postgres_searcher.py:23
Functiontest_postgres_build_filter_clause_without_filters
(postgres_searcher)
tests/test_postgres_searcher.py:7
Functiontest_postgres_searcher_search
(postgres_searcher)
tests/test_postgres_searcher.py:40
Functiontest_postgres_searcher_search_and_embed
(postgres_searcher)
tests/test_postgres_searcher.py:52
Functiontest_postgres_searcher_search_and_embed_empty_text_search
(postgres_searcher)
tests/test_postgres_searcher.py:47
Functiontest_postgres_searcher_search_empty_text_search
(postgres_searcher)
tests/test_postgres_searcher.py:35
Functiontest_search_handler
test the search_handler route
tests/test_api_routes.py:83
Functiontest_search_handler_422
test the search_handler route with missing query parameters
tests/test_api_routes.py:99
Functiontest_similar_handler
test the similar_handler route
tests/test_api_routes.py:37
Functiontest_similar_handler_404
test the similar_handler route with a non-existent item
tests/test_api_routes.py:71
Functiontest_similar_handler_422
test the similar_handler route with missing query parameters
tests/test_api_routes.py:60
Functiontest_simple_chat_flow
test the simple chat flow route with hybrid retrieval mode
tests/test_api_routes.py:110
Functiontest_simple_chat_flow_message_history
test the simple chat flow route with hybrid retrieval mode
tests/test_api_routes.py:129
Functiontest_simple_chat_streaming_flow
test the simple chat streaming flow route with hybrid retrieval mode
tests/test_api_routes.py:152
Methodto_str_for_rag
(self)
src/backend/fastapi_app/api_models.py:39
Functionupdate_password_token
(dialect, conn_rec, cargs, cparams)
src/backend/fastapi_app/postgres_engine.py:47
← previous101–182 of 182, ranked by callers