kognios 1.1.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 (92) hide show
  1. kognios-1.1.0/.github/ISSUE_TEMPLATE/bug_report.md +48 -0
  2. kognios-1.1.0/.github/ISSUE_TEMPLATE/feature_request.md +35 -0
  3. kognios-1.1.0/.github/pull_request_template.md +29 -0
  4. kognios-1.1.0/.github/workflows/ci.yml +35 -0
  5. kognios-1.1.0/.gitignore +20 -0
  6. kognios-1.1.0/CHANGELOG.md +100 -0
  7. kognios-1.1.0/CONTRIBUTING.md +230 -0
  8. kognios-1.1.0/LICENSE +21 -0
  9. kognios-1.1.0/Makefile +19 -0
  10. kognios-1.1.0/PKG-INFO +649 -0
  11. kognios-1.1.0/README.md +591 -0
  12. kognios-1.1.0/ROADMAP.md +88 -0
  13. kognios-1.1.0/examples/agent_with_knowledge.py +29 -0
  14. kognios-1.1.0/examples/agent_with_mcp.py +47 -0
  15. kognios-1.1.0/examples/agent_with_memory.py +33 -0
  16. kognios-1.1.0/examples/agent_with_planning.py +27 -0
  17. kognios-1.1.0/examples/agent_with_semantic_memory.py +37 -0
  18. kognios-1.1.0/examples/agent_with_tools.py +36 -0
  19. kognios-1.1.0/examples/basic_agent.py +12 -0
  20. kognios-1.1.0/examples/eval_example.py +40 -0
  21. kognios-1.1.0/examples/multi_agent_team.py +49 -0
  22. kognios-1.1.0/examples/redis_memory_plugin/README.md +70 -0
  23. kognios-1.1.0/examples/redis_memory_plugin/pyproject.toml +20 -0
  24. kognios-1.1.0/examples/redis_memory_plugin/redis_memory.py +125 -0
  25. kognios-1.1.0/examples/redis_memory_plugin/tests/test_redis_memory.py +213 -0
  26. kognios-1.1.0/kognios/__init__.py +57 -0
  27. kognios-1.1.0/kognios/agent.py +414 -0
  28. kognios-1.1.0/kognios/cli.py +380 -0
  29. kognios-1.1.0/kognios/eval/__init__.py +7 -0
  30. kognios-1.1.0/kognios/eval/harness.py +158 -0
  31. kognios-1.1.0/kognios/eval/scorers.py +50 -0
  32. kognios-1.1.0/kognios/guardrails/__init__.py +17 -0
  33. kognios-1.1.0/kognios/guardrails/base.py +13 -0
  34. kognios-1.1.0/kognios/guardrails/builtins.py +67 -0
  35. kognios-1.1.0/kognios/knowledge/__init__.py +3 -0
  36. kognios-1.1.0/kognios/knowledge/base.py +12 -0
  37. kognios-1.1.0/kognios/knowledge/loaders.py +173 -0
  38. kognios-1.1.0/kognios/knowledge/numpy_vector.py +71 -0
  39. kognios-1.1.0/kognios/knowledge/sqlite_fts.py +61 -0
  40. kognios-1.1.0/kognios/mcp/__init__.py +3 -0
  41. kognios-1.1.0/kognios/mcp/client.py +216 -0
  42. kognios-1.1.0/kognios/memory/__init__.py +4 -0
  43. kognios-1.1.0/kognios/memory/long_term.py +91 -0
  44. kognios-1.1.0/kognios/memory/short_term.py +33 -0
  45. kognios-1.1.0/kognios/models/__init__.py +0 -0
  46. kognios-1.1.0/kognios/models/anthropic.py +136 -0
  47. kognios-1.1.0/kognios/models/base.py +76 -0
  48. kognios-1.1.0/kognios/models/bedrock.py +105 -0
  49. kognios-1.1.0/kognios/models/cohere.py +17 -0
  50. kognios-1.1.0/kognios/models/gemini.py +15 -0
  51. kognios-1.1.0/kognios/models/groq.py +15 -0
  52. kognios-1.1.0/kognios/models/mistral.py +17 -0
  53. kognios-1.1.0/kognios/models/ollama.py +22 -0
  54. kognios-1.1.0/kognios/models/openai.py +140 -0
  55. kognios-1.1.0/kognios/plugins.py +55 -0
  56. kognios-1.1.0/kognios/storage/__init__.py +0 -0
  57. kognios-1.1.0/kognios/storage/sqlite.py +39 -0
  58. kognios-1.1.0/kognios/team.py +48 -0
  59. kognios-1.1.0/kognios/tools/__init__.py +3 -0
  60. kognios-1.1.0/kognios/tools/builtins/__init__.py +19 -0
  61. kognios-1.1.0/kognios/tools/builtins/browser.py +47 -0
  62. kognios-1.1.0/kognios/tools/builtins/calculator.py +69 -0
  63. kognios-1.1.0/kognios/tools/builtins/code_interpreter.py +48 -0
  64. kognios-1.1.0/kognios/tools/builtins/http_get.py +16 -0
  65. kognios-1.1.0/kognios/tools/builtins/python_eval.py +20 -0
  66. kognios-1.1.0/kognios/tools/builtins/read_file.py +16 -0
  67. kognios-1.1.0/kognios/tools/builtins/web_search.py +27 -0
  68. kognios-1.1.0/kognios/tools/builtins/write_file.py +17 -0
  69. kognios-1.1.0/kognios/tools/registry.py +116 -0
  70. kognios-1.1.0/kognios/tracing.py +121 -0
  71. kognios-1.1.0/pyproject.toml +67 -0
  72. kognios-1.1.0/tests/__init__.py +0 -0
  73. kognios-1.1.0/tests/test_agent.py +88 -0
  74. kognios-1.1.0/tests/test_browser_bedrock.py +86 -0
  75. kognios-1.1.0/tests/test_builtins.py +66 -0
  76. kognios-1.1.0/tests/test_eval.py +111 -0
  77. kognios-1.1.0/tests/test_guardrails.py +99 -0
  78. kognios-1.1.0/tests/test_integration_examples.py +54 -0
  79. kognios-1.1.0/tests/test_knowledge.py +39 -0
  80. kognios-1.1.0/tests/test_loaders.py +81 -0
  81. kognios-1.1.0/tests/test_ltm_semantic.py +67 -0
  82. kognios-1.1.0/tests/test_mcp.py +186 -0
  83. kognios-1.1.0/tests/test_memory.py +63 -0
  84. kognios-1.1.0/tests/test_plugins.py +55 -0
  85. kognios-1.1.0/tests/test_providers.py +34 -0
  86. kognios-1.1.0/tests/test_streaming.py +63 -0
  87. kognios-1.1.0/tests/test_tools.py +71 -0
  88. kognios-1.1.0/tests/test_tracing.py +161 -0
  89. kognios-1.1.0/tests/test_v03_features.py +117 -0
  90. kognios-1.1.0/tests/test_v04_planning.py +97 -0
  91. kognios-1.1.0/tests/test_v11_features.py +269 -0
  92. kognios-1.1.0/tests/test_vector_knowledge.py +46 -0
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: Bug report
3
+ about: Something isn't working as expected
4
+ title: "[BUG] "
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Describe the bug
10
+
11
+ A clear, concise description of what went wrong.
12
+
13
+ ## Minimal reproduction
14
+
15
+ ```python
16
+ # paste the smallest snippet that reproduces the issue
17
+ from kognios import Agent, AnthropicModel
18
+
19
+ agent = Agent(model=AnthropicModel())
20
+ agent.run("...")
21
+ ```
22
+
23
+ ## Expected behaviour
24
+
25
+ What you expected to happen.
26
+
27
+ ## Actual behaviour
28
+
29
+ What actually happened. Include the **full traceback** if applicable.
30
+
31
+ ```
32
+ Traceback (most recent call last):
33
+ ...
34
+ ```
35
+
36
+ ## Environment
37
+
38
+ | Item | Version |
39
+ |---|---|
40
+ | Python | `python --version` |
41
+ | kognios | `pip show kognios` |
42
+ | Provider | Anthropic / OpenAI / Groq / Gemini |
43
+ | Model | e.g. claude-sonnet-4-6 |
44
+ | OS | Windows / macOS / Linux |
45
+
46
+ ## Additional context
47
+
48
+ Anything else that might help — screenshots, related issues, etc.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: Feature request
3
+ about: Propose a new feature or improvement
4
+ title: "[FEAT] "
5
+ labels: enhancement
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Summary
10
+
11
+ One sentence describing the feature.
12
+
13
+ ## Problem / motivation
14
+
15
+ What problem does this solve? Who benefits?
16
+
17
+ ## Proposed solution
18
+
19
+ Describe what the API / behaviour should look like. Code examples are great.
20
+
21
+ ```python
22
+ # e.g.
23
+ from kognios.models.cohere import CohereModel
24
+ agent = Agent(model=CohereModel(), ...)
25
+ ```
26
+
27
+ ## Alternatives considered
28
+
29
+ Other approaches you thought about and why you ruled them out.
30
+
31
+ ## Checklist
32
+
33
+ - [ ] I've checked the [ROADMAP](../ROADMAP.md) — this isn't already planned
34
+ - [ ] I've searched [existing issues](https://github.com/lavkeshdwivedi/kogniOS/issues) for duplicates
35
+ - [ ] I'm willing to submit a PR for this (optional but appreciated!)
@@ -0,0 +1,29 @@
1
+ ## Summary
2
+
3
+ <!-- 1-3 bullet points describing what this PR does and why -->
4
+
5
+ -
6
+ -
7
+
8
+ ## Type of change
9
+
10
+ - [ ] Bug fix
11
+ - [ ] New feature
12
+ - [ ] Breaking change
13
+ - [ ] Documentation update
14
+ - [ ] Refactor / cleanup
15
+
16
+ ## Testing
17
+
18
+ <!-- Describe how you tested this change -->
19
+
20
+ - [ ] Added / updated unit tests in `tests/`
21
+ - [ ] All existing tests pass (`pytest tests/ -v`)
22
+ - [ ] Linter passes (`ruff check kognios tests`)
23
+ - [ ] Tested manually with a real provider (optional but helpful)
24
+
25
+ ## Checklist
26
+
27
+ - [ ] My code follows the project's [coding conventions](CONTRIBUTING.md#coding-conventions)
28
+ - [ ] I've updated the docstrings / README / CHANGELOG where appropriate
29
+ - [ ] No new external dependencies added (or explained in the PR description)
@@ -0,0 +1,35 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ name: Test (Python ${{ matrix.python-version }})
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ python-version: ["3.11", "3.12", "3.13"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Set up Python ${{ matrix.python-version }}
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+
25
+ - name: Install dependencies
26
+ run: pip install -e ".[dev]"
27
+
28
+ - name: Lint
29
+ run: ruff check kognios tests
30
+
31
+ - name: Format check
32
+ run: ruff format --check kognios tests
33
+
34
+ - name: Run tests
35
+ run: pytest tests/ -v --tb=short
@@ -0,0 +1,20 @@
1
+ # Temp files
2
+ *.b64.txt
3
+ C*Tempreadme*.txt
4
+ *Tempreadme*.txt
5
+
6
+ # Python
7
+ __pycache__/
8
+ *.py[cod]
9
+ *.egg-info/
10
+ dist/
11
+ build/
12
+ .venv/
13
+ *.egg
14
+
15
+ # Databases
16
+ *.db
17
+
18
+ # OS
19
+ .DS_Store
20
+ Thumbs.db
@@ -0,0 +1,100 @@
1
+ # Changelog
2
+
3
+ All notable changes to Kogni·OS are documented here.
4
+ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5
+
6
+ ---
7
+
8
+ ## [Unreleased]
9
+
10
+ ---
11
+
12
+ ## [1.1.0] — 2026-07-07
13
+
14
+ ### Added
15
+ - **`kognios serve` streaming** — `POST /stream` SSE endpoint; each token delivered as `data: {"text": "..."}`, terminated with `data: [DONE]`.
16
+ - **`kognios serve` session management** — `POST /session` creates a named session backed by `ShortTermMemory`; `POST /session/{id}/run` and `POST /session/{id}/stream` are stateful across turns; `DELETE /session/{id}` cleans up.
17
+ - **`kognios serve --kb <db>`** — attach a `SQLiteKnowledge` knowledge base (created by `kognios ingest`) to the served agent; all endpoints (stateless and session) use it for RAG.
18
+ - **`kognios serve` health endpoint** — `GET /health` returns `{"status": "ok", "provider": ..., "model": ...}`.
19
+ - **All 8 providers in `kognios serve`** — mistral, cohere, and bedrock now available via `--provider`.
20
+ - **`kognios eval <dataset.json>`** — CLI command to run a JSON eval dataset against any provider/model; supports `--scorer contains|exact_match|regex_match` and `--threshold`.
21
+ - **`kognios ingest <file>`** — CLI command to ingest documents (plain text, PDF, HTML, CSV, JSON, DOCX, URL) into a persistent SQLite knowledge base (`--backend fts|vector`). Reports chunk count on completion.
22
+ - **Smart fact injection** — `Agent._build_system` calls `LongTermMemory.semantic_recall(query, top_k=5)` instead of `all_facts()` when `embed_fn` is set, so only query-relevant facts enter the system prompt.
23
+ - **`LongTermMemory` safe as agent memory** — `Agent.run` and `arun` now guard `memory.append` with `hasattr`, so `LongTermMemory` can be passed as the `memory` argument without raising `AttributeError`.
24
+ - **`KnowledgeBase.load()` returns chunk count** — `SQLiteKnowledge.load()` and `NumpyVectorKnowledge.load()` now return `int` (number of chunks stored).
25
+
26
+ ---
27
+
28
+ ## [Unreleased — pre-1.1 additions]
29
+
30
+ ### Added
31
+ - **Prometheus Tracer sink** — `prometheus_sink()` factory in `kognios/tracing.py`.
32
+ Records span duration as `kognios_span_duration_seconds` (Histogram) and errors as
33
+ `kognios_span_errors_total` (Counter), both labelled by `span.name`.
34
+ Requires `prometheus-client>=0.17`; install via `pip install 'kognios[prometheus]'`.
35
+ New `prometheus` optional extra added to `pyproject.toml`; also included in `[all]`.
36
+ - **Redis memory plugin example** — `examples/redis_memory_plugin/` with a
37
+ `RedisLongTermMemory` class duck-typing the `LongTermMemory` interface
38
+ (`remember`, `recall`, `facts`), Redis hash storage, optional TTL, lazy import,
39
+ entry-point registration under `kognios.memory`, and 15 unit tests requiring no
40
+ real Redis server.
41
+ - **PyPI build readiness** — `python -m build` produces `dist/kognios-1.0.0.whl`
42
+ and `dist/kognios-1.0.0.tar.gz`; both pass `python -m twine check dist/*`.
43
+ Ready to upload with `python -m twine upload dist/*`.
44
+
45
+ ### Changed
46
+ - Default `pytest` run now excludes integration tests automatically via
47
+ `addopts = "-m 'not integration'"` in `pyproject.toml`. Run integration
48
+ tests explicitly with `pytest -m integration`.
49
+
50
+ ---
51
+
52
+ ## [1.0.0] — 2026-07-06
53
+
54
+ ### Added
55
+ - **Plugin system** — third-party providers/tools/memory discoverable via Python entry points (`kognios.providers`, `kognios.tools`, `kognios.memory`)
56
+ - **`__version__`** attribute (importlib.metadata)
57
+ - **Stable public API** with semantic versioning guarantees from this release onward
58
+
59
+ ### v1.0 features (all shipped in this release)
60
+ - `AgentEvaluator` — run test datasets through an agent; scorers: `exact_match`, `contains`, `regex_match`, `llm_judge`
61
+ - Guardrails — `block_keywords`, `max_length`, `pii_scrubber`, `profanity_filter`; `input_guardrails`/`output_guardrails` on `Agent`
62
+ - `Tracer` — span-based observability for LLM calls and tool executions; sink callbacks and OpenTelemetry stub
63
+
64
+ ---
65
+
66
+ ## [0.3.0] — 2026-07-06
67
+
68
+ ### Added
69
+ - **Providers**: Ollama (local), Mistral, Cohere Command R+, AWS Bedrock
70
+ - **Parallel tool execution** — `asyncio.gather` across tool calls in `arun`/`astream`
71
+ - **Token counting** — `agent.last_usage` dict accumulated across the full run
72
+ - **Persistent sessions** — `ShortTermMemory.save(path)` / `.load(path)`
73
+ - **`NumpyVectorKnowledge`** — cosine similarity semantic search with pluggable `embed_fn`
74
+ - **`LongTermMemory.semantic_recall(query)`** — semantic search over stored facts
75
+ - **Knowledge loaders** — HTML, CSV, JSON, DOCX, GitHub repo crawler
76
+ - **Multi-step planning** — `Agent.plan_and_run()` / `aplan_and_run()`
77
+ - **Agent-to-agent messaging** — `Agent.send()` / `asend()`
78
+ - **`code_interpreter` builtin** — subprocess-isolated exec with timeout
79
+ - **`browse` builtin** — Playwright (headless Chromium) with urllib fallback
80
+ - **MCP client** — `MCPClient` connects agents to any MCP server via stdio or SSE
81
+ - **`kognios serve`** — FastAPI `POST /run` endpoint
82
+ - 115 tests (up from 38)
83
+
84
+ ---
85
+
86
+ ## [0.2.0] — 2026-06-01 (initial public release)
87
+
88
+ ### Added
89
+ - `Agent` with ReAct loop, `@tool` decorator, JSON schema auto-gen
90
+ - `ShortTermMemory` (sliding-window RAM buffer)
91
+ - `LongTermMemory` (SQLite key/value, auto-injected into system prompt)
92
+ - `SQLiteKnowledge` — FTS5 BM25 full-text search
93
+ - `Team` routing — router LLM picks named sub-agent
94
+ - Streaming (`agent.stream()`) and async (`agent.arun()`, `agent.astream()`)
95
+ - Structured output via Pydantic models
96
+ - Providers: Anthropic, OpenAI, Groq, Gemini
97
+ - Built-in tools: `calculator`, `python_eval`, `read_file`, `write_file`, `http_get`, `web_search`
98
+ - CLI: `kognios chat`, `kognios ask`
99
+ - PDF ingestion (`kognios[pdf]`)
100
+ - 38 unit tests
@@ -0,0 +1,230 @@
1
+ # Contributing to Kogni·OS
2
+
3
+ Thank you for considering a contribution! This document covers everything
4
+ you need to go from idea → merged PR.
5
+
6
+ ---
7
+
8
+ ## Table of contents
9
+
10
+ 1. [Quick setup](#quick-setup)
11
+ 2. [Project structure](#project-structure)
12
+ 3. [Running tests](#running-tests)
13
+ 4. [Coding conventions](#coding-conventions)
14
+ 5. [Adding a new model provider](#adding-a-new-model-provider)
15
+ 6. [Adding a new built-in tool](#adding-a-new-built-in-tool)
16
+ 7. [Submitting a PR](#submitting-a-pr)
17
+ 8. [Reporting bugs](#reporting-bugs)
18
+
19
+ ---
20
+
21
+ ## Quick setup
22
+
23
+ ```bash
24
+ # Windows (recommended local path)
25
+ cd C:\Claude\Projects
26
+ git clone https://github.com/lavkeshdwivedi/kogniOS
27
+ cd kogniOS
28
+
29
+ # macOS / Linux
30
+ git clone https://github.com/lavkeshdwivedi/kogniOS
31
+ cd kogniOS
32
+
33
+ # Install in editable mode with dev dependencies
34
+ pip install -e ".[dev]"
35
+
36
+ # Run the test suite (no API key needed — all mocked)
37
+ pytest tests/ -v
38
+ ```
39
+
40
+ Python **3.11 or newer** is required.
41
+
42
+ ---
43
+
44
+ ## Project structure
45
+
46
+ ```
47
+ kognios/ ← the importable package
48
+ agent.py ← Agent class + ReAct loop
49
+ team.py ← Team router
50
+ cli.py ← Click CLI (kognios chat / kognios ask)
51
+ models/ ← provider adapters
52
+ tools/ ← @tool decorator + built-in tools
53
+ memory/ ← short-term (RAM) + long-term (SQLite)
54
+ knowledge/ ← FTS5 RAG pipeline
55
+ storage/ ← shared SQLite connection + migrations
56
+ examples/ ← runnable demos (require an API key)
57
+ tests/ ← unit tests (mocked, no key needed)
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Running tests
63
+
64
+ ```bash
65
+ pytest tests/ -v # all tests
66
+ pytest tests/test_agent.py -v # single file
67
+ pytest -k "memory" -v # filter by name
68
+ ```
69
+
70
+ Tests live in `tests/` and use `unittest.mock`. No external services are
71
+ called — every LLM response is a `MagicMock`.
72
+
73
+ To lint:
74
+
75
+ ```bash
76
+ ruff check kognios tests
77
+ ruff format --check kognios tests
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Coding conventions
83
+
84
+ - **Python 3.11+** syntax — use `X | Y` unions, `list[T]`, `dict[K, V]`.
85
+ - **`from __future__ import annotations`** at the top of every module.
86
+ - **No comments** unless the *why* is genuinely non-obvious. Good names are enough.
87
+ - **No extra abstractions** — three similar lines beat a premature helper.
88
+ - **No new dependencies** without a strong reason. SQLite + stdlib is the baseline.
89
+ - Line length: **100** (enforced by `ruff`).
90
+ - Format with `ruff format` before opening a PR.
91
+
92
+ ---
93
+
94
+ ## Adding a new model provider
95
+
96
+ 1. Create `kognios/models/<name>.py`.
97
+ 2. Subclass `BaseModel` from `kognios.models.base`.
98
+ 3. Implement `complete()` — required abstract method.
99
+ 4. Optionally override `stream()`, `acomplete()`, `astream()`, `structured_complete()`.
100
+ 5. Export from `kognios/__init__.py`.
101
+ 6. Add a row to the provider table in `README.md`.
102
+
103
+ Minimal example (OpenAI-compatible endpoint):
104
+
105
+ ```python
106
+ # kognios/models/cohere.py
107
+ from __future__ import annotations
108
+ import os
109
+ from .openai import OpenAIModel
110
+
111
+ class CohereModel(OpenAIModel):
112
+ def __init__(self, model: str = "command-r-plus", **kwargs):
113
+ super().__init__(
114
+ model=model,
115
+ api_key=os.environ.get("COHERE_API_KEY", ""),
116
+ base_url="https://api.cohere.com/compatibility/v1",
117
+ **kwargs,
118
+ )
119
+ ```
120
+
121
+ If the provider uses a non-OpenAI wire format, subclass `BaseModel` directly
122
+ and look at `kognios/models/anthropic.py` as a reference.
123
+
124
+ Add a test in `tests/test_agent.py` or a new `tests/test_<name>_model.py` that
125
+ mocks the underlying SDK call and asserts `ModelResponse` fields.
126
+
127
+ ---
128
+
129
+ ## Adding a new built-in tool
130
+
131
+ 1. Create `kognios/tools/builtins/<name>.py`.
132
+ 2. Decorate your function with `@tool` from `kognios.tools.registry`.
133
+ 3. Add a type-hinted docstring — the first line becomes the tool description.
134
+ 4. Export from `kognios/tools/builtins/__init__.py`.
135
+ 5. Add tests to `tests/test_builtins.py`.
136
+
137
+ ```python
138
+ # kognios/tools/builtins/uuid_gen.py
139
+ from __future__ import annotations
140
+ import uuid
141
+ from ..registry import tool
142
+
143
+ @tool
144
+ def generate_uuid() -> str:
145
+ """Generate a random UUID v4."""
146
+ return str(uuid.uuid4())
147
+ ```
148
+
149
+ ---
150
+
151
+ ## Submitting a PR
152
+
153
+ 1. **Fork** the repo and create a feature branch:
154
+ ```bash
155
+ git checkout -b feat/my-feature
156
+ ```
157
+ 2. Make your changes, write tests, run `pytest` and `ruff check`.
158
+ 3. Commit with a clear message:
159
+ ```
160
+ feat: add CohereModel provider
161
+ fix: handle empty tool_calls in OpenAI streaming
162
+ docs: add structured output example to README
163
+ ```
164
+ 4. Push and open a pull request against `main`.
165
+ 5. Fill in the PR template — describe *what* changed and *why*.
166
+
167
+ PRs that pass CI and include tests will be reviewed promptly.
168
+
169
+ ---
170
+
171
+ ## Reporting bugs
172
+
173
+ Open a [GitHub Issue](https://github.com/lavkeshdwivedi/kogniOS/issues/new/choose)
174
+ using the **Bug report** template. Include:
175
+
176
+ - Python version (`python --version`)
177
+ - Kogni·OS version (`pip show kognios`)
178
+ - Provider and model you were using
179
+ - Minimal reproduction snippet
180
+ - Full traceback
181
+
182
+ ---
183
+
184
+ ## Code of conduct
185
+
186
+ Be kind and constructive. Disagreements about code are fine; personal attacks
187
+ are not. We follow the [Contributor Covenant](https://www.contributor-covenant.org/).
188
+
189
+ ---
190
+
191
+ ## Publishing to PyPI
192
+
193
+ Build and publish (maintainers only):
194
+
195
+ ```bash
196
+ # Install build tools
197
+ pip install build twine
198
+
199
+ # Build wheel + sdist
200
+ python -m build
201
+
202
+ # Upload to PyPI (requires PyPI API token)
203
+ twine upload dist/*
204
+
205
+ # Or upload to TestPyPI first:
206
+ twine upload --repository testpypi dist/*
207
+ pip install --index-url https://test.pypi.org/simple/ kognios
208
+ ```
209
+
210
+ Users can install directly from PyPI:
211
+ ```bash
212
+ pip install kognios
213
+ pip install 'kognios[all]' # all optional deps
214
+ ```
215
+
216
+ ---
217
+
218
+ ## Running integration tests
219
+
220
+ Unit tests (default, no API keys needed):
221
+ ```bash
222
+ pytest tests/ -m "not integration"
223
+ ```
224
+
225
+ Integration tests (require real API keys):
226
+ ```bash
227
+ export ANTHROPIC_API_KEY=...
228
+ export OPENAI_API_KEY=...
229
+ pytest tests/ -m integration -v
230
+ ```
kognios-1.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lavkesh Dwivedi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
kognios-1.1.0/Makefile ADDED
@@ -0,0 +1,19 @@
1
+ .PHONY: test lint format build clean
2
+
3
+ test:
4
+ python -m pytest tests/ -m "not integration" -v
5
+
6
+ test-all:
7
+ python -m pytest tests/ -v
8
+
9
+ lint:
10
+ python -m ruff check kognios/ tests/
11
+
12
+ format:
13
+ python -m ruff format kognios/ tests/
14
+
15
+ build:
16
+ python -m build
17
+
18
+ clean:
19
+ rm -rf dist/ build/ *.egg-info/ __pycache__/