kimss 0.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.
kimss-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,68 @@
1
+ Metadata-Version: 2.4
2
+ Name: kimss
3
+ Version: 0.1.0
4
+ Summary: Kimss Python SDK for conversational AI agents
5
+ License: MIT
6
+ Classifier: License :: OSI Approved :: MIT License
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.9
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
13
+ Requires-Python: >=3.9
14
+ Description-Content-Type: text/markdown
15
+ Requires-Dist: requests>=2.28
16
+ Provides-Extra: dev
17
+ Requires-Dist: pytest>=7; extra == "dev"
18
+
19
+ # Kimss Python SDK
20
+
21
+ Lightweight client for the [Kimss](https://kimss.ai) API. Use it to call your Kimss agents from Python scripts, backends, or notebooks.
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ pip install kimss
27
+ ```
28
+
29
+ Or from this repo (editable):
30
+
31
+ ```bash
32
+ cd kimss_sdk && pip install -e .
33
+ ```
34
+
35
+ ## Authentication
36
+
37
+ Use a **long-lived API key** (not a browser session token). Create keys in your Kimss app under **Developer Settings → API Keys**. The key is scoped to your tenant and user.
38
+
39
+ ## Usage
40
+
41
+ ```python
42
+ from kimss import KimssClient, Agent
43
+
44
+ client = KimssClient(
45
+ api_key="kimss_xxxxxxxxxxxxxxxxxxxxxxxx", # from Developer Settings
46
+ base_url="https://api.kimss.ai", # or your deployment URL
47
+ )
48
+
49
+ # Get an agent and send a message
50
+ agent = client.get_agent(agent_id="asst_xxxx")
51
+ result = agent.query("Hello")
52
+ # result is the API "res" payload (run_id, thread_id, messages, usage, etc.)
53
+
54
+ # Continue a thread
55
+ result2 = agent.query("What did I just say?", thread_id=result.get("thread_id"))
56
+
57
+ # Or use the client directly
58
+ result3 = client.chat(assistant_id="asst_xxxx", message="Hi", thread_id=result.get("thread_id"))
59
+ ```
60
+
61
+ ## API
62
+
63
+ - **`KimssClient(api_key, base_url="https://api.kimss.ai")`** – authenticated client.
64
+ - **`client.get_agent(agent_id)`** – returns an `Agent` for that assistant.
65
+ - **`agent.query(message, thread_id=None, chat_type="user_chat")`** – send a message; returns the `res` object from `POST /assistant_chat/`.
66
+ - **`client.chat(assistant_id, message, thread_id=None, chat_type="user_chat")`** – one-off chat without an Agent handle.
67
+
68
+ All requests use the `X-Kimss-Key` header. No streaming in this version; responses are full JSON.
kimss-0.1.0/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # Kimss Python SDK
2
+
3
+ Lightweight client for the [Kimss](https://kimss.ai) API. Use it to call your Kimss agents from Python scripts, backends, or notebooks.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pip install kimss
9
+ ```
10
+
11
+ Or from this repo (editable):
12
+
13
+ ```bash
14
+ cd kimss_sdk && pip install -e .
15
+ ```
16
+
17
+ ## Authentication
18
+
19
+ Use a **long-lived API key** (not a browser session token). Create keys in your Kimss app under **Developer Settings → API Keys**. The key is scoped to your tenant and user.
20
+
21
+ ## Usage
22
+
23
+ ```python
24
+ from kimss import KimssClient, Agent
25
+
26
+ client = KimssClient(
27
+ api_key="kimss_xxxxxxxxxxxxxxxxxxxxxxxx", # from Developer Settings
28
+ base_url="https://api.kimss.ai", # or your deployment URL
29
+ )
30
+
31
+ # Get an agent and send a message
32
+ agent = client.get_agent(agent_id="asst_xxxx")
33
+ result = agent.query("Hello")
34
+ # result is the API "res" payload (run_id, thread_id, messages, usage, etc.)
35
+
36
+ # Continue a thread
37
+ result2 = agent.query("What did I just say?", thread_id=result.get("thread_id"))
38
+
39
+ # Or use the client directly
40
+ result3 = client.chat(assistant_id="asst_xxxx", message="Hi", thread_id=result.get("thread_id"))
41
+ ```
42
+
43
+ ## API
44
+
45
+ - **`KimssClient(api_key, base_url="https://api.kimss.ai")`** – authenticated client.
46
+ - **`client.get_agent(agent_id)`** – returns an `Agent` for that assistant.
47
+ - **`agent.query(message, thread_id=None, chat_type="user_chat")`** – send a message; returns the `res` object from `POST /assistant_chat/`.
48
+ - **`client.chat(assistant_id, message, thread_id=None, chat_type="user_chat")`** – one-off chat without an Agent handle.
49
+
50
+ All requests use the `X-Kimss-Key` header. No streaming in this version; responses are full JSON.
@@ -0,0 +1,4 @@
1
+ """Kimss Python SDK – lightweight client for Kimss conversational AI API."""
2
+ from .client import KimssClient, Agent
3
+
4
+ __all__ = ["KimssClient", "Agent"]
@@ -0,0 +1,73 @@
1
+ """
2
+ Kimss API client and Agent wrapper.
3
+ Use X-Kimss-Key for authentication (long-lived API key from your Kimss Developer Settings).
4
+ """
5
+ from __future__ import annotations
6
+
7
+ from typing import Any, Dict, Optional
8
+
9
+ import requests
10
+
11
+
12
+ class KimssClient:
13
+ """
14
+ Client for the Kimss API. Authenticate with a long-lived API key.
15
+ Create keys at: your Kimss app → Developer Settings → API Keys.
16
+ """
17
+
18
+ def __init__(self, api_key: str, base_url: str = "https://api.kimss.ai"):
19
+ self.api_key = api_key.strip()
20
+ self.base_url = base_url.rstrip("/")
21
+ self.headers = {"X-Kimss-Key": self.api_key, "Content-Type": "application/json"}
22
+
23
+ def get_agent(self, agent_id: str) -> "Agent":
24
+ """Return an Agent handle for the given assistant/agent id."""
25
+ return Agent(self, agent_id)
26
+
27
+ def chat(
28
+ self,
29
+ assistant_id: str,
30
+ message: str,
31
+ thread_id: Optional[str] = None,
32
+ chat_type: str = "user_chat",
33
+ ) -> Dict[str, Any]:
34
+ """
35
+ Send a message to an assistant and return the response.
36
+ Same as get_agent(assistant_id).query(message, thread_id).
37
+ """
38
+ return self.get_agent(assistant_id).query(message, thread_id=thread_id, chat_type=chat_type)
39
+
40
+
41
+ class Agent:
42
+ """Handle for a single Kimss assistant/agent."""
43
+
44
+ def __init__(self, client: KimssClient, agent_id: str):
45
+ self._client = client
46
+ self.id = agent_id
47
+
48
+ def query(
49
+ self,
50
+ message: str,
51
+ thread_id: Optional[str] = None,
52
+ chat_type: str = "user_chat",
53
+ ) -> Dict[str, Any]:
54
+ """
55
+ Send a message to this agent and return the API response (res payload).
56
+ Optionally pass thread_id to continue a conversation.
57
+ """
58
+ payload: Dict[str, Any] = {
59
+ "assistant_id": self.id,
60
+ "usr_chat": message,
61
+ "chat_type": chat_type,
62
+ }
63
+ if thread_id is not None and str(thread_id).strip():
64
+ payload["thread_id"] = str(thread_id).strip()
65
+ response = requests.post(
66
+ f"{self._client.base_url}/assistant_chat/",
67
+ json=payload,
68
+ headers=self._client.headers,
69
+ timeout=120,
70
+ )
71
+ response.raise_for_status()
72
+ data = response.json()
73
+ return data.get("res", data)
@@ -0,0 +1,68 @@
1
+ Metadata-Version: 2.4
2
+ Name: kimss
3
+ Version: 0.1.0
4
+ Summary: Kimss Python SDK for conversational AI agents
5
+ License: MIT
6
+ Classifier: License :: OSI Approved :: MIT License
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.9
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
13
+ Requires-Python: >=3.9
14
+ Description-Content-Type: text/markdown
15
+ Requires-Dist: requests>=2.28
16
+ Provides-Extra: dev
17
+ Requires-Dist: pytest>=7; extra == "dev"
18
+
19
+ # Kimss Python SDK
20
+
21
+ Lightweight client for the [Kimss](https://kimss.ai) API. Use it to call your Kimss agents from Python scripts, backends, or notebooks.
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ pip install kimss
27
+ ```
28
+
29
+ Or from this repo (editable):
30
+
31
+ ```bash
32
+ cd kimss_sdk && pip install -e .
33
+ ```
34
+
35
+ ## Authentication
36
+
37
+ Use a **long-lived API key** (not a browser session token). Create keys in your Kimss app under **Developer Settings → API Keys**. The key is scoped to your tenant and user.
38
+
39
+ ## Usage
40
+
41
+ ```python
42
+ from kimss import KimssClient, Agent
43
+
44
+ client = KimssClient(
45
+ api_key="kimss_xxxxxxxxxxxxxxxxxxxxxxxx", # from Developer Settings
46
+ base_url="https://api.kimss.ai", # or your deployment URL
47
+ )
48
+
49
+ # Get an agent and send a message
50
+ agent = client.get_agent(agent_id="asst_xxxx")
51
+ result = agent.query("Hello")
52
+ # result is the API "res" payload (run_id, thread_id, messages, usage, etc.)
53
+
54
+ # Continue a thread
55
+ result2 = agent.query("What did I just say?", thread_id=result.get("thread_id"))
56
+
57
+ # Or use the client directly
58
+ result3 = client.chat(assistant_id="asst_xxxx", message="Hi", thread_id=result.get("thread_id"))
59
+ ```
60
+
61
+ ## API
62
+
63
+ - **`KimssClient(api_key, base_url="https://api.kimss.ai")`** – authenticated client.
64
+ - **`client.get_agent(agent_id)`** – returns an `Agent` for that assistant.
65
+ - **`agent.query(message, thread_id=None, chat_type="user_chat")`** – send a message; returns the `res` object from `POST /assistant_chat/`.
66
+ - **`client.chat(assistant_id, message, thread_id=None, chat_type="user_chat")`** – one-off chat without an Agent handle.
67
+
68
+ All requests use the `X-Kimss-Key` header. No streaming in this version; responses are full JSON.
@@ -0,0 +1,9 @@
1
+ README.md
2
+ pyproject.toml
3
+ kimss/__init__.py
4
+ kimss/client.py
5
+ kimss.egg-info/PKG-INFO
6
+ kimss.egg-info/SOURCES.txt
7
+ kimss.egg-info/dependency_links.txt
8
+ kimss.egg-info/requires.txt
9
+ kimss.egg-info/top_level.txt
@@ -0,0 +1,4 @@
1
+ requests>=2.28
2
+
3
+ [dev]
4
+ pytest>=7
@@ -0,0 +1 @@
1
+ kimss
@@ -0,0 +1,32 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "kimss"
7
+ version = "0.1.0"
8
+ description = "Kimss Python SDK for conversational AI agents"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = { text = "MIT" }
12
+ dependencies = [
13
+ "requests>=2.28",
14
+ ]
15
+ classifiers = [
16
+ "License :: OSI Approved :: MIT License",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.9",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Topic :: Software Development :: Libraries :: Python Modules",
23
+ ]
24
+
25
+ [project.optional-dependencies]
26
+ dev = [
27
+ "pytest>=7",
28
+ ]
29
+
30
+ [tool.setuptools.packages.find]
31
+ where = ["."]
32
+ include = ["kimss*"]
kimss-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+