diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 25c7e5c..2ff5ed8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: rev: v1.5.0 hooks: - id: detect-secrets - args: ["--baseline", ".secrets.baseline"] + args: ["--baseline", ".secrets.baseline", "--exclude-secrets", "your-api-key"] exclude: | (?x)^( .*\.lock$| diff --git a/.python-version b/.python-version index e4fba21..24ee5b1 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.12 +3.13 diff --git a/pyproject.toml b/pyproject.toml index 7c3608b..503025f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,15 +6,17 @@ authors = [ {name = "Giskard Team", email = "hello@giskard.ai"} ] readme = "README.md" -requires-python = ">=3.10,<4.0" -dependencies = [] +requires-python = ">=3.13,<4.0" +dependencies = [ + "giskard-core @ git+ssh://git@github.com/Giskard-AI/giskard-oss.git@main#subdirectory=libs/giskard-core", + "giskard-agents @ git+ssh://git@github.com/Giskard-AI/giskard-oss.git@main#subdirectory=libs/giskard-agents", + "giskard-checks @ git+ssh://git@github.com/Giskard-AI/giskard-oss.git@main#subdirectory=libs/giskard-checks", +] [dependency-groups] dev = [ "sphinxawesome-theme==5.3.2; python_version>='3.12'", "myst-parser==4.0.1; python_version>='3.12'", - "notebook==7.4.7", - "nbsphinx==0.9.7; python_version>='3.12'", "sphinx-click==6.1.0; python_version>='3.12'", "sphinx-autobuild==2025.8.25; python_version>='3.12'", "sphinx-autodoc-typehints==2.3.0; python_version>='3.12'", @@ -22,13 +24,8 @@ dev = [ "sphinx-tabs>=3.4.7; python_version>='3.12'", "sphinxext-opengraph[social_cards]>=0.12.0; python_version>='3.12'", "sphinx-notfound-page>=1.1.0; python_version>='3.12'", - "pandoc>=2.4", "sphinxcontrib-mermaid>=0.9.0; python_version>='3.12'", - "giskard[llm]==2.18.0; python_version>='3.10' and python_version<'3.13'", "pyarrow<21.0.1; python_version>='3.12'", - "ragas>=0.3.7,<=0.3.7", - "ipywidgets>=8.1.7", - "torch>=2.8.0", "sphinx-autobuild>=2024.10.3", "giskard-hub>=2.1.0", "sphinxext-rediraffe" @@ -39,12 +36,3 @@ dev = [ Homepage = "https://github.com/Giskard-AI/giskard-hub" Repository = "https://github.com/Giskard-AI/giskard-hub" Documentation = "https://docs.giskard.ai/" - -[[tool.uv.index]] -name = "pytorch_cpu" -url = "https://download.pytorch.org/whl/cpu" -explicit = true - -[tool.uv.sources] -# Use CPU-only PyTorch for non-macOS systems, default PyPI for macOS -torch = { index = "pytorch_cpu", marker = "platform_system != 'Darwin'" } diff --git a/source/_static/custom.css b/source/_static/custom.css index 05959e8..6978b41 100644 --- a/source/_static/custom.css +++ b/source/_static/custom.css @@ -27,6 +27,7 @@ --sidebar-heading-color: #0f1729; --non-selected-color: rgba(15, 23, 41, 0.6); --link-color: inherit; + --border: 0 0% 100% / 0.10; } .dark { @@ -420,6 +421,14 @@ header nav a:not(.text-foreground):hover { color: rgba(198, 255, 255, 0.8) !important; } +#left-sidebar a.current { + border: none; +} + +#left-sidebar ul ul:is(.dark *)::before { + background-color: hsl(var(--border)); +} + /* Recently selected navbar item styling */ header nav a.recently-selected, html[data-content_root="./"] header nav a.recently-selected, diff --git a/source/_static/images/oss/checks/quickstart-simple_example_result.png b/source/_static/images/oss/checks/quickstart-simple_example_result.png new file mode 100644 index 0000000..983c1ab Binary files /dev/null and b/source/_static/images/oss/checks/quickstart-simple_example_result.png differ diff --git a/source/_static/images/oss/checks/quickstart-structured_interactions.png b/source/_static/images/oss/checks/quickstart-structured_interactions.png new file mode 100644 index 0000000..86f255e Binary files /dev/null and b/source/_static/images/oss/checks/quickstart-structured_interactions.png differ diff --git a/source/_templates/sidebars/sidebar_oss_checks.html b/source/_templates/sidebars/sidebar_oss_checks.html new file mode 100644 index 0000000..73b6049 --- /dev/null +++ b/source/_templates/sidebars/sidebar_oss_checks.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/source/conf.py b/source/conf.py index 1e76eb2..abb12fb 100644 --- a/source/conf.py +++ b/source/conf.py @@ -70,7 +70,6 @@ def update_sidebar_templates(): extensions = [ "myst_parser", - "nbsphinx", "sphinx_design", "sphinx.ext.todo", "sphinx.ext.napoleon", @@ -133,21 +132,6 @@ def update_sidebar_templates(): else: branch = docs_version.replace("-", "/") branch = "main" - -# -- Options for nbsphinx ---------------------------------------------------- -nbsphinx_execute = "never" -# fmt: off -nbsphinx_prolog = """ -.. raw:: html - -
-""" -# fmt: on - - theme_options = ThemeOptions( show_prev_next=True, show_scrolltop=True, @@ -158,7 +142,7 @@ def update_sidebar_templates(): "Overview": "/index", "Hub UI": "/hub/ui/index", "Hub SDK": "/hub/sdk/index", - "Open Source": "/oss/sdk/index", + "Checks": "/oss/checks/index", }, ) html_theme_options = asdict(theme_options) @@ -175,7 +159,12 @@ def update_sidebar_templates(): } # Use wildcard patterns to support any nested path within the specified routes +# oss/checks/** must come before oss/** for correct pattern matching html_sidebars: dict[str, list[str]] = { + "oss/checks/**": [ + "sidebar_main_nav_links.html", + "sidebars/sidebar_oss_checks.html", + ], "hub/ui/**": ["sidebars/sidebar_hub_ui.html"], "hub/sdk/**": ["sidebars/sidebar_hub_sdk.html"], "oss/**": ["sidebars/sidebar_oss_sdk.html"], @@ -193,6 +182,49 @@ def update_sidebar_templates(): ogp_image = "https://docs.giskard.ai/_static/open-graph-image.png" +# Add custom template function to render toctree from a specific document +def setup(app): + def html_page_context(app, pagename, templatename, context, doctree): + def toctree_from_doc(docname, **kwargs): + """Render toctree starting from a specific document""" + from sphinx.environment.adapters.toctree import TocTree + from sphinx import addnodes + source_doctree = app.env.get_doctree(docname) + toctrees = list(source_doctree.findall(addnodes.toctree)) + + if not toctrees: + return "" + + toctree_adapter = TocTree(app.env) + resolved = [ + toctree_adapter.resolve( + pagename, # Use current page context, not the toctree source + app.builder, + toctree, + prune=False, + maxdepth=kwargs.get("maxdepth", -1), + titles_only=kwargs.get("titles_only", False), + collapse=kwargs.get("collapse", False), + includehidden=kwargs.get("includehidden", False), + ) + for toctree in toctrees + ] + + resolved = [r for r in resolved if r is not None] + if not resolved: + return "" + + result = resolved[0] + for toctree in resolved[1:]: + result.extend(toctree.children) + + return app.builder.render_partial(result)["fragment"] + + context["toctree_from_doc"] = toctree_from_doc + + app.connect("html-page-context", html_page_context) + + # make github links resolve def linkcode_resolve(domain, info): if domain != "py": diff --git a/source/index.rst b/source/index.rst index 0f3662b..7d6ef47 100644 --- a/source/index.rst +++ b/source/index.rst @@ -46,7 +46,6 @@ Giskard Hub Ready to unlock the full potential of enterprise-grade AI testing? Try **Giskard Hub** with a free trial and discover advanced team collaboration, continuous red teaming, and enterprise security features. :doc:`Start your free enterprise trial ` and see how Giskard Hub can transform your AI testing workflow. - Open source ----------- @@ -74,7 +73,6 @@ The library provides a set of tools for testing and evaluating LLMs, including: **⚖️ Unsure about the difference between Open Source and Hub?** Check out our :doc:`/start/comparison` guide to learn more about the different features. - Open research ------------- @@ -107,8 +105,6 @@ Some work has been funded by the `the European Commission| \n", - " | question | \n", - "reference_answer | \n", - "reference_context | \n", - "conversation_history | \n", - "metadata | \n", - "
|---|---|---|---|---|---|
| id | \n", - "\n", - " | \n", - " | \n", - " | \n", - " | \n", - " |
| 35202be3-9120-4bd1-9b3b-722d3b307e1c | \n", - "What is the role of Joint Supervisory Teams (JSTs) in the supervision of Significant Institutions (SIs)? | \n", - "The day-to-day supervision of SIs is primarily conducted off-site by the JSTs, which comprise staff from NCAs and the ECB and are supported by the horizontal and specialised expertise divisions of DG/HOL and similar staff at the NCAs. The JST analyses the supervisory reporting, financial statements and internal documentation of supervised entities, holds regular and ad hoc meetings with the su... | \n", - "Document 76: This can involve on-site interventions at supervised institutions, if needed. \\nDepending on a specific bank’s risk profile assessment, the ECB may impose a wide \\nrange of supervisory measures. \\n2.3.1 \\nJoint Supervisory Teams \\nThe day-to-day supervision of SIs is primarily conducted off-site by the JSTs, which \\ncomprise staff from NCAs and the ECB and are supported by the hor... | \n", - "[] | \n", - "{'question_type': 'simple', 'seed_document_id': 76, 'topic': 'Others'} | \n", - "
| 1beb42a0-ff1a-42e9-91c6-fe11774e909d | \n", - "What happens if an urgent supervisory decision is necessary to prevent significant damage to the financial system? | \n", - "The ECB may adopt a supervisory decision which would adversely affect the rights of the addressee without giving it the opportunity to comment on the decision prior to its adoption. In this case, the hearing is postponed, and a clear justification is provided in the decision as to why the postponement is necessary. The hearing is then organised as soon as possible after the adoption of the dec... | \n", - "Document 34: Supervisory Manual – Functioning of the Single Supervisory Mechanism \\n \\n21 \\nFigure 4 \\nDecision-making process \\n \\n*The deadline for submitting comments/objections in a written procedure is five working days, while the deadline for non-objection \\nprocedures is a maximum of ten working days. \\n**The applicable legal deadlines for each specific case must be taken into account. ... | \n", - "[] | \n", - "{'question_type': 'simple', 'seed_document_id': 34, 'topic': 'Single Supervisory Mechanism'} | \n", - "
| 562d7352-b2ee-4191-b6eb-96f0fca7b01c | \n", - "What is required of banks and investment firms in the EU that are subsidiaries of third-country groups according to Article 21b of Directive 2013/36/EU? | \n", - "Article 21b of Directive 2013/36/EU requires banks and investment firms in the EU that are subsidiaries of third-country groups to set up a single intermediate EU parent undertaking if the third-country group has two or more institutions established within the EU with a combined total asset value of at least €40 billion. | \n", - "Document 169: Supervisory Manual – Supervision of significant institutions \\n \\n97 \\ntransactions which go beyond the contractual obligations of a sponsor institution or \\nan originator institution under Article 248(1) of Regulation (EU) No 575/2013. \\nBased on the notifications received from significant institutions: \\n• \\nif the institution declares that there is implicit support, the JST ch... | \n", - "[] | \n", - "{'question_type': 'simple', 'seed_document_id': 169, 'topic': 'Others'} | \n", - "
| a9955bdc-165d-42ed-a259-53bef0d5e0ea | \n", - "What are the purposes of macroprudential extensions in stress tests? | \n", - "Macroprudential extensions in stress tests focus on system-wide effects rather than on individual banks and are run in a top-down manner. They capture important feedback effects or network effects, which can occur through adverse changes in the state of the environment triggered by a stress scenario with a negative impact on lending or through lending or funding links between institutions. | \n", - "Document 125: These tasks are undertaken, where \\nappropriate, in collaboration with other divisions of the ECB, the EBA and/or NCAs. \\nMicroprudential stress tests are often complemented by macroprudential extensions \\nthat focus on system-wide effects rather than on individual banks and which are run \\nin a top-down manner, meaning that they do not involve the supervised entities. In \\nparti... | \n", - "[] | \n", - "{'question_type': 'simple', 'seed_document_id': 125, 'topic': 'European Banking Supervision'} | \n", - "
| a7c255f1-9fd8-48d8-8a6a-5afa995dae21 | \n", - "What happens if a quorum of 50% is not met during an emergency Supervisory Board meeting? | \n", - "If a quorum of 50% in the Supervisory Board for emergency situations is not met, the meeting will be closed and an extraordinary meeting will be held soon afterwards. | \n", - "Document 38: Supervisory Manual – Functioning of the Single Supervisory Mechanism \\n \\n24 \\n• \\nif an NCA which is concerned by the decision has different views regarding the \\nobjection, the NCA may request mediation; \\n• \\nif no request for mediation is submitted, the Supervisory Board may amend the \\ndraft decision in order to incorporate the comments of the Governing Council; \\n• \\nif the ... | \n", - "[] | \n", - "{'question_type': 'simple', 'seed_document_id': 38, 'topic': 'Single Supervisory Mechanism'} | \n", - "
| \n", - " | question | \n", - "reference_answer | \n", - "reference_context | \n", - "conversation_history | \n", - "metadata | \n", - "
|---|---|---|---|---|---|
| id | \n", - "\n", - " | \n", - " | \n", - " | \n", - " | \n", - " |
| 1cacb231-b6e3-44aa-a315-79aa43cff369 | \n", - "When is the best estimate of reaching 1.5°C of global warming according to most scenarios? | \n", - "The best estimate of reaching 1.5°C of global warming lies in the first half of the 2030s in most of the considered scenarios and modelled pathways. | \n", - "Document 116: The best estimate of reaching 1.5°C of global \\nwarming lies in the first half of the 2030s in most of the considered \\nscenarios and modelled pathways114. In the very low GHG emissions \\nscenario (SSP1-1.9), CO2 emissions reach net zero around 2050 and the \\nbest-estimate end-of-century warming is 1.4°C, after a temporary overshoot \\n(see Section 3.3.4) of no more than 0.1°C abov... | \n", - "[] | \n", - "{'question_type': 'simple', 'seed_document_id': 116, 'topic': 'Climate Change Mitigation Scenarios'} | \n", - "
| d785c257-4c44-443c-99dd-7d72a296da9f | \n", - "What are the projected global emissions for 2030 based on policies implemented by the end of 2020? | \n", - "The median projected global emissions for 2030 based on policies implemented by the end of 2020 are 57 GtCO2-eq/yr, with a range of 52–60 GtCO2-eq/yr. | \n", - "Document 82: Emissions projections for 2030 and gross differences in emissions are based on emissions of 52–56 GtCO2-eq yr–1 in 2019 as assumed in underlying model \\nstudies97. (medium confidence) {WGIII Table SPM.1} (Table 3.1, Cross-Section Box.2) \\n95 \\nAbatement here refers to human interventions that reduce the amount of GHGs that are released from fossil fuel infrastructure to the atmosph... | \n", - "[] | \n", - "{'question_type': 'simple', 'seed_document_id': 82, 'topic': 'Global Greenhouse Gas Emissions and Climate Policy'} | \n", - "
| 0646700a-9617-4dad-9a12-f84a6048ca9d | \n", - "What are some key barriers to the implementation of adaptation options in vulnerable sectors? | \n", - "Key barriers include limited resources, lack of private-sector and civic engagement, insufficient mobilisation of finance, lack of political commitment, limited research and/or slow and low uptake of adaptation science, and a low sense of urgency. | \n", - "Document 95: 62\\nSection 2\\nSection 1\\nSection 2\\nfire-adapted ecosystems, or hard defences against flooding) and human \\nsettlements (e.g. stranded assets and vulnerable communities that \\ncannot afford to shift away or adapt and require an increase in social \\nsafety nets). Maladaptation especially affects marginalised and vulnerable \\ngroups adversely (e.g., Indigenous Peoples, ethnic minorit... | \n", - "[] | \n", - "{'question_type': 'simple', 'seed_document_id': 95, 'topic': 'Others'} | \n", - "
| 0d78955c-f9c8-41ad-9ba4-a2670da4e63c | \n", - "What are some irreversible changes projected due to continued GHG emissions? | \n", - "Many changes due to past and future GHG emissions are irreversible on centennial to millennial time scales, especially in the ocean, ice sheets, and global sea level. | \n", - "Document 118: {WGI SPM D.1.7, WGI Box TS.7} (Cross-Section Box.2)\\nContinued GHG emissions will further affect all major climate \\nsystem components, and many changes will be irreversible on \\ncentennial to millennial time scales. Many changes in the climate \\nsystem become larger in direct relation to increasing global warming. \\nWith every additional increment of global warming, changes in \\... | \n", - "[] | \n", - "{'question_type': 'simple', 'seed_document_id': 118, 'topic': 'Others'} | \n", - "
| 00d34731-7f09-446d-80fb-40c0b20b547a | \n", - "What are some options for scaling up mitigation and adaptation in developing regions according to the context? | \n", - "Options include increased levels of public finance and publicly mobilised private finance flows from developed to developing countries, increasing the use of public guarantees to reduce risks and leverage private flows at lower cost, local capital markets development, and building greater trust in international cooperation processes. | \n", - "Document 291: Accelerated support \\nfrom developed countries and multilateral institutions is a critical \\nenabler to enhance mitigation and adaptation action and can address \\ninequities in finance, including its costs, terms and conditions, and \\neconomic vulnerability to climate change. Scaled-up public grants for \\nmitigation and adaptation funding for vulnerable regions, e.g., in Sub-\\nSah... | \n", - "[] | \n", - "{'question_type': 'simple', 'seed_document_id': 291, 'topic': 'Climate Change Mitigation and Adaptation'} | \n", - "