not-again-ai 0.17.0__tar.gz → 0.18.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. not_again_ai-0.18.0/.editorconfig +7 -0
  2. not_again_ai-0.18.0/.gitattributes +2 -0
  3. not_again_ai-0.18.0/.github/_typos.toml +5 -0
  4. not_again_ai-0.18.0/.github/copilot-instructions.md +10 -0
  5. not_again_ai-0.18.0/.github/workflows/codeql-analysis.yml +72 -0
  6. not_again_ai-0.18.0/.github/workflows/python.yml +72 -0
  7. not_again_ai-0.18.0/.gitignore +135 -0
  8. not_again_ai-0.18.0/.vscode/launch.json +16 -0
  9. not_again_ai-0.18.0/.vscode/settings.json +20 -0
  10. not_again_ai-0.17.0/README.md → not_again_ai-0.18.0/PKG-INFO +84 -139
  11. not_again_ai-0.17.0/PKG-INFO → not_again_ai-0.18.0/README.md +41 -182
  12. not_again_ai-0.18.0/assets/barplot_test4.png +0 -0
  13. not_again_ai-0.18.0/assets/distributions_test4.svg +2026 -0
  14. not_again_ai-0.18.0/assets/scatterplot_basic1.png +0 -0
  15. not_again_ai-0.18.0/assets/ts_lineplot5.svg +2339 -0
  16. not_again_ai-0.18.0/notebooks/base/base.ipynb +156 -0
  17. not_again_ai-0.18.0/notebooks/llm/01_openai_chat_completion.ipynb +267 -0
  18. not_again_ai-0.18.0/notebooks/llm/02_ollama_intro.ipynb +152 -0
  19. not_again_ai-0.18.0/notebooks/llm/03_llm_streaming.ipynb +188 -0
  20. not_again_ai-0.18.0/notebooks/llm/10_gpt-4-v.ipynb +175 -0
  21. not_again_ai-0.18.0/notebooks/llm/20_embeddings.ipynb +133 -0
  22. not_again_ai-0.18.0/notebooks/statistics/statistics.ipynb +159 -0
  23. not_again_ai-0.18.0/notebooks/viz/viz.ipynb +238 -0
  24. not_again_ai-0.18.0/noxfile.py +99 -0
  25. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/pyproject.toml +48 -60
  26. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/chat_completion/interface.py +4 -0
  27. not_again_ai-0.18.0/src/not_again_ai/llm/chat_completion/providers/anthropic_api.py +180 -0
  28. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/chat_completion/types.py +5 -1
  29. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/prompting/compile_prompt.py +3 -3
  30. not_again_ai-0.18.0/src/not_again_ai/llm/prompting/providers/__init__.py +0 -0
  31. not_again_ai-0.18.0/tests/__init__.py +0 -0
  32. not_again_ai-0.18.0/tests/base/__init__.py +0 -0
  33. not_again_ai-0.18.0/tests/base/test_file_system.py +18 -0
  34. not_again_ai-0.18.0/tests/base/test_parallel.py +83 -0
  35. not_again_ai-0.18.0/tests/data/__init__.py +0 -0
  36. not_again_ai-0.18.0/tests/data/test_web.py +28 -0
  37. not_again_ai-0.18.0/tests/llm/__init__.py +0 -0
  38. not_again_ai-0.18.0/tests/llm/chat_completion/__init__.py +0 -0
  39. not_again_ai-0.18.0/tests/llm/chat_completion/test_chat_completion.py +1316 -0
  40. not_again_ai-0.18.0/tests/llm/chat_completion/test_chat_completion_stream.py +553 -0
  41. not_again_ai-0.18.0/tests/llm/embedding/__init__.py +0 -0
  42. not_again_ai-0.18.0/tests/llm/embedding/test_embedding.py +98 -0
  43. not_again_ai-0.18.0/tests/llm/prompting/__init__.py +0 -0
  44. not_again_ai-0.18.0/tests/llm/prompting/test_compile_messages.py +365 -0
  45. not_again_ai-0.18.0/tests/llm/prompting/test_tokenizer.py +63 -0
  46. not_again_ai-0.18.0/tests/llm/sample_images/SKDiagram.png +0 -0
  47. not_again_ai-0.18.0/tests/llm/sample_images/SKInfographic.png +0 -0
  48. not_again_ai-0.18.0/tests/llm/sample_images/cat.jpg +0 -0
  49. not_again_ai-0.18.0/tests/llm/sample_images/dog.jpg +0 -0
  50. not_again_ai-0.18.0/tests/llm/sample_images/numbers.png +0 -0
  51. not_again_ai-0.18.0/tests/statistics/__init__.py +0 -0
  52. not_again_ai-0.18.0/tests/statistics/test_dependence.py +140 -0
  53. not_again_ai-0.18.0/tests/viz/__init__.py +0 -0
  54. not_again_ai-0.18.0/tests/viz/test_barplot.py +52 -0
  55. not_again_ai-0.18.0/tests/viz/test_distributions.py +43 -0
  56. not_again_ai-0.18.0/tests/viz/test_scatterplot.py +22 -0
  57. not_again_ai-0.18.0/tests/viz/test_time_series.py +69 -0
  58. not_again_ai-0.18.0/uv.lock +2201 -0
  59. not_again_ai-0.17.0/src/not_again_ai/llm/__init__.py +0 -15
  60. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/LICENSE +0 -0
  61. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/__init__.py +0 -0
  62. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/base/__init__.py +0 -0
  63. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/base/file_system.py +0 -0
  64. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/base/parallel.py +0 -0
  65. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/data/__init__.py +0 -0
  66. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/data/web.py +0 -0
  67. {not_again_ai-0.17.0/src/not_again_ai/llm/chat_completion/providers → not_again_ai-0.18.0/src/not_again_ai/llm}/__init__.py +0 -0
  68. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/chat_completion/__init__.py +0 -0
  69. {not_again_ai-0.17.0/src/not_again_ai/llm/embedding → not_again_ai-0.18.0/src/not_again_ai/llm/chat_completion}/providers/__init__.py +0 -0
  70. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/chat_completion/providers/ollama_api.py +0 -0
  71. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/chat_completion/providers/openai_api.py +0 -0
  72. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/embedding/__init__.py +0 -0
  73. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/embedding/interface.py +0 -0
  74. {not_again_ai-0.17.0/src/not_again_ai/llm/prompting → not_again_ai-0.18.0/src/not_again_ai/llm/embedding}/providers/__init__.py +0 -0
  75. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/embedding/providers/ollama_api.py +0 -0
  76. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/embedding/providers/openai_api.py +0 -0
  77. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/embedding/types.py +0 -0
  78. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/prompting/__init__.py +0 -0
  79. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/prompting/interface.py +0 -0
  80. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/prompting/providers/openai_tiktoken.py +0 -0
  81. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/llm/prompting/types.py +0 -0
  82. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/py.typed +0 -0
  83. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/statistics/__init__.py +0 -0
  84. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/statistics/dependence.py +0 -0
  85. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/viz/__init__.py +0 -0
  86. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/viz/barplots.py +0 -0
  87. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/viz/distributions.py +0 -0
  88. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/viz/scatterplot.py +0 -0
  89. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/viz/time_series.py +0 -0
  90. {not_again_ai-0.17.0 → not_again_ai-0.18.0}/src/not_again_ai/viz/utils.py +0 -0
@@ -0,0 +1,7 @@
1
+ # For information about this file, see: https://editorconfig.org/
2
+ root = true
3
+
4
+ # For ease of fitting multiple editor panes side by side consistently, set all files types to use
5
+ # the same relaxed max line length permitted in PEP 8.
6
+ [*]
7
+ max_line_length = 120
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -0,0 +1,5 @@
1
+ [default.extend-identifiers]
2
+ arange = "arange" # np.arange
3
+
4
+ [files]
5
+ extend-exclude = ["*.ipynb"]
@@ -0,0 +1,10 @@
1
+ # Python Rules
2
+ - The user is using Python version >= 3.11 with uv as the Python package and project manager.
3
+ - Follow the Google Python Style Guide.
4
+ - Instead of importing `Optional` from typing, using the `| `syntax.
5
+ - Always add appropriate type hintssuch that the code would pass a mypy type check.
6
+ - For type hints, use `list`, not `List`. For example, if the variable is `[{"name": "Jane", "age": 32}, {"name": "Amy", "age": 28}]` the type hint should be `list[dict]`
7
+ - If the user is using Pydantic, it is version >=2.10
8
+ - Always prefer pathlib for dealing with files. Use `Path.open` instead of `open`.
9
+ - Prefer to use pendulum instead of datetime
10
+ - Prefer to use loguru instead of logging
@@ -0,0 +1,72 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ "main" ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ "main" ]
20
+ schedule:
21
+ - cron: '30 5 * * *'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'python' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v3
42
+
43
+ # Initializes the CodeQL tools for scanning.
44
+ - name: Initialize CodeQL
45
+ uses: github/codeql-action/init@v2
46
+ with:
47
+ languages: ${{ matrix.language }}
48
+ # If you wish to specify custom queries, you can do so here or in a config file.
49
+ # By default, queries listed here will override any specified in a config file.
50
+ # Prefix the list here with "+" to use these queries and those in the config file.
51
+
52
+ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53
+ # queries: security-extended,security-and-quality
54
+
55
+
56
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57
+ # If this step fails, then you should remove it and run the build manually (see below)
58
+ - name: Autobuild
59
+ uses: github/codeql-action/autobuild@v2
60
+
61
+ # ℹ️ Command-line programs to run using the OS shell.
62
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63
+
64
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
65
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66
+
67
+ # - run: |
68
+ # echo "Run, Build Application using script"
69
+ # ./location_of_script_within_repo/buildscript.sh
70
+
71
+ - name: Perform CodeQL Analysis
72
+ uses: github/codeql-action/analyze@v2
@@ -0,0 +1,72 @@
1
+ name: python
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ branches: ["main"]
7
+ push:
8
+ branches: ["main"]
9
+
10
+ env:
11
+ UV_VERSION: "0.6.9"
12
+ PYTHON_VERSION: "3.12"
13
+
14
+ jobs:
15
+ test:
16
+ runs-on: ubuntu-24.04
17
+ strategy:
18
+ matrix:
19
+ python-version: [ "3.11", "3.12" ]
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v5
24
+ # Caching is enabled by default for GitHub-hosted runners:
25
+ # https://github.com/astral-sh/setup-uv?tab=readme-ov-file#enable-caching
26
+ with:
27
+ version: ${{ env.UV_VERSION }}
28
+ - name: Set up Python ${{ matrix.python-version }}
29
+ uses: actions/setup-python@v5
30
+ with:
31
+ python-version: ${{ matrix.python-version }}
32
+ - name: Install Nox
33
+ run: uv sync --locked --all-extras
34
+ - name: Test with Nox
35
+ env:
36
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
37
+ OPENAI_ORG_ID: ${{ secrets.OPENAI_ORG_ID }}
38
+ SKIP_TESTS_NAAI: "tests/llm/chat_completion tests/llm/embedding tests/data"
39
+ run: uv run nox -s test-${{ matrix.python-version }}
40
+ quality:
41
+ runs-on: ubuntu-24.04
42
+ strategy:
43
+ matrix:
44
+ nox-session: ["lint", "type_check", "typos"]
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+ - name: Install uv
48
+ uses: astral-sh/setup-uv@v5
49
+ with:
50
+ version: ${{ env.UV_VERSION }}
51
+ - name: Set up Python
52
+ uses: actions/setup-python@v5
53
+ with:
54
+ python-version: ${{ env.PYTHON_VERSION }}
55
+ - name: Install dependencies
56
+ run: uv sync --locked --all-extras
57
+ - name: Test with Nox
58
+ run: uv run nox -s ${{ matrix.nox-session }}
59
+ lock-check:
60
+ runs-on: ubuntu-24.04
61
+ steps:
62
+ - uses: actions/checkout@v4
63
+ - name: Install uv
64
+ uses: astral-sh/setup-uv@v5
65
+ with:
66
+ version: ${{ env.UV_VERSION }}
67
+ - name: Set up Python
68
+ uses: actions/setup-python@v5
69
+ with:
70
+ python-version: ${{ env.PYTHON_VERSION }}
71
+ - name: Validate Lockfile Up-to-date
72
+ run: uv lock --check
@@ -0,0 +1,135 @@
1
+ # Project Specific
2
+ notebooks/**/*.png
3
+
4
+ # Byte-compiled / optimized / DLL files
5
+ __pycache__/
6
+ *.py[cod]
7
+ *$py.class
8
+
9
+ # C extensions
10
+ *.so
11
+
12
+ # Distribution / packaging
13
+ .Python
14
+ build/
15
+ develop-eggs/
16
+ dist/
17
+ downloads/
18
+ eggs/
19
+ .eggs/
20
+ lib/
21
+ lib64/
22
+ parts/
23
+ sdist/
24
+ var/
25
+ wheels/
26
+ pip-wheel-metadata/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py,cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+
57
+ # Translations
58
+ *.mo
59
+ *.pot
60
+
61
+ # Django stuff:
62
+ *.log
63
+ local_settings.py
64
+ db.sqlite3
65
+ db.sqlite3-journal
66
+
67
+ # Flask stuff:
68
+ instance/
69
+ .webassets-cache
70
+
71
+ # Scrapy stuff:
72
+ .scrapy
73
+
74
+ # Sphinx documentation
75
+ docs/_build/
76
+
77
+ # PyBuilder
78
+ target/
79
+
80
+ # Jupyter Notebook
81
+ .ipynb_checkpoints
82
+
83
+ # IPython
84
+ profile_default/
85
+ ipython_config.py
86
+
87
+ # pyenv
88
+ .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
98
+ __pypackages__/
99
+
100
+ # Celery stuff
101
+ celerybeat-schedule
102
+ celerybeat.pid
103
+
104
+ # SageMath parsed files
105
+ *.sage.py
106
+
107
+ # Environments
108
+ .env
109
+ .venv
110
+ env/
111
+ venv/
112
+ ENV/
113
+ env.bak/
114
+ venv.bak/
115
+
116
+ # Spyder project settings
117
+ .spyderproject
118
+ .spyproject
119
+
120
+ # Rope project settings
121
+ .ropeproject
122
+
123
+ # mkdocs documentation
124
+ /site
125
+
126
+ # mypy
127
+ .mypy_cache/
128
+ .dmypy.json
129
+ dmypy.json
130
+
131
+ # Pyre type checker
132
+ .pyre/
133
+
134
+ # Ruff
135
+ .ruff_cache/
@@ -0,0 +1,16 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "Python Debugger: Current File",
9
+ "type": "debugpy",
10
+ "request": "launch",
11
+ "program": "${file}",
12
+ "console": "integratedTerminal",
13
+ "justMyCode": true
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "ruff.configuration": "./pyproject.toml",
3
+ "notebook.formatOnSave.enabled": true,
4
+ "notebook.codeActionsOnSave": {
5
+ "notebook.source.fixAll": "explicit",
6
+ "notebook.source.organizeImports": "explicit"
7
+ },
8
+ "[python]": {
9
+ "editor.formatOnSave": true,
10
+ "editor.codeActionsOnSave": {
11
+ "source.fixAll": "explicit",
12
+ "source.organizeImports": "explicit"
13
+ },
14
+ "editor.defaultFormatter": "charliermarsh.ruff"
15
+ },
16
+ "python.testing.unittestEnabled": false,
17
+ "python.testing.pytestEnabled": true,
18
+ "python.testing.pytestArgs": ["-s"],
19
+ "markdown.extension.orderedList.marker": "one",
20
+ }