ai-parrot-client-jev 0.2.5__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.
@@ -0,0 +1,72 @@
1
+ Metadata-Version: 2.4
2
+ Name: ai-parrot-client-jev
3
+ Version: 0.2.5
4
+ Summary: TypeSafe AI System One (Jev) client for AI-Parrot (parrot.clients.jev)
5
+ Author-email: Jesus Lara <jesuslara@phenobarbital.info>
6
+ License-Expression: MIT
7
+ Requires-Python: <3.14,>=3.11
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: ai-parrot>=1.0.5
10
+
11
+ # ai-parrot-client-jev
12
+
13
+ TypeSafe AI **System One** client satellite for
14
+ [AI-Parrot](https://github.com/phenobarbital/ai-parrot), targeting the
15
+ **Jev** model.
16
+
17
+ Jev is not a text generator: you send it *state* (a string or JSON document)
18
+ plus typed *questions* and it returns structured answers with calibrated
19
+ probabilities — a `choice` from a fixed set, a `score` on an ordered rubric,
20
+ or a `noul` (yes/no) probability. `parrot.clients.jev.JevClient` maps that
21
+ contract onto the `AbstractClient` interface:
22
+
23
+ - `ask(prompt, questions=...)` — the prompt (plus optional system prompt and
24
+ conversation history) becomes the state; the answers come back as an
25
+ `AIMessage` whose `output` / `structured_output` is a `SystemOneResponse`.
26
+ - `invoke(prompt, output_type=MyModel)` — a Pydantic model is translated into
27
+ questions (`bool` → noul, `Literal`/`Enum` → choice, `int`/`float` with
28
+ `criteria` levels → score) and the answers are validated back into it.
29
+ - `system_one(state, questions)` — the raw, typed API call.
30
+
31
+ ```bash
32
+ uv pip install ai-parrot-client-jev
33
+ export TYPESAFE_API_KEY=...
34
+ ```
35
+
36
+ ```python
37
+ from parrot.clients.jev import JevClient, Choice, Noul, Score
38
+
39
+ client = JevClient() # reads TYPESAFE_API_KEY; calls jev-latest by default
40
+ ticket = (
41
+ "Hi, I've been trying to connect my Stripe account for 3 days and it keeps "
42
+ "failing. I'm losing sales. Please help ASAP."
43
+ )
44
+ response = await client.system_one(
45
+ state=ticket,
46
+ questions={
47
+ "department": Choice(
48
+ instructions="Which team should handle this",
49
+ criteria={
50
+ "billing": "Payment or subscription issues",
51
+ "technical": "Bugs or integration problems",
52
+ "sales": "Pricing or account questions",
53
+ },
54
+ ),
55
+ "frustration": Score(
56
+ instructions="How frustrated the customer appears",
57
+ criteria=["Calm, just stating facts", "Frustrated but civil", "Very angry, strong language"],
58
+ ),
59
+ "is_urgent": Noul(instructions="The message conveys urgency or time-sensitivity"),
60
+ },
61
+ )
62
+ response.answers["department"].choice # "billing"
63
+ response.answers["frustration"].score # 1.035
64
+ response.answers["is_urgent"].noul # 0.999
65
+ ```
66
+
67
+ Models (`JevModel`): `jev-latest` (default alias, stable), `jev-preview`
68
+ (alias, newest build), `jev-1.13.0` (versioned). Text input only; 64k tokens
69
+ per request. Output tokens are free.
70
+
71
+ Registers itself with `LLMFactory` under the `jev` and `typesafe` provider
72
+ keys via the `parrot.clients` entry-point group.
@@ -0,0 +1,62 @@
1
+ # ai-parrot-client-jev
2
+
3
+ TypeSafe AI **System One** client satellite for
4
+ [AI-Parrot](https://github.com/phenobarbital/ai-parrot), targeting the
5
+ **Jev** model.
6
+
7
+ Jev is not a text generator: you send it *state* (a string or JSON document)
8
+ plus typed *questions* and it returns structured answers with calibrated
9
+ probabilities — a `choice` from a fixed set, a `score` on an ordered rubric,
10
+ or a `noul` (yes/no) probability. `parrot.clients.jev.JevClient` maps that
11
+ contract onto the `AbstractClient` interface:
12
+
13
+ - `ask(prompt, questions=...)` — the prompt (plus optional system prompt and
14
+ conversation history) becomes the state; the answers come back as an
15
+ `AIMessage` whose `output` / `structured_output` is a `SystemOneResponse`.
16
+ - `invoke(prompt, output_type=MyModel)` — a Pydantic model is translated into
17
+ questions (`bool` → noul, `Literal`/`Enum` → choice, `int`/`float` with
18
+ `criteria` levels → score) and the answers are validated back into it.
19
+ - `system_one(state, questions)` — the raw, typed API call.
20
+
21
+ ```bash
22
+ uv pip install ai-parrot-client-jev
23
+ export TYPESAFE_API_KEY=...
24
+ ```
25
+
26
+ ```python
27
+ from parrot.clients.jev import JevClient, Choice, Noul, Score
28
+
29
+ client = JevClient() # reads TYPESAFE_API_KEY; calls jev-latest by default
30
+ ticket = (
31
+ "Hi, I've been trying to connect my Stripe account for 3 days and it keeps "
32
+ "failing. I'm losing sales. Please help ASAP."
33
+ )
34
+ response = await client.system_one(
35
+ state=ticket,
36
+ questions={
37
+ "department": Choice(
38
+ instructions="Which team should handle this",
39
+ criteria={
40
+ "billing": "Payment or subscription issues",
41
+ "technical": "Bugs or integration problems",
42
+ "sales": "Pricing or account questions",
43
+ },
44
+ ),
45
+ "frustration": Score(
46
+ instructions="How frustrated the customer appears",
47
+ criteria=["Calm, just stating facts", "Frustrated but civil", "Very angry, strong language"],
48
+ ),
49
+ "is_urgent": Noul(instructions="The message conveys urgency or time-sensitivity"),
50
+ },
51
+ )
52
+ response.answers["department"].choice # "billing"
53
+ response.answers["frustration"].score # 1.035
54
+ response.answers["is_urgent"].noul # 0.999
55
+ ```
56
+
57
+ Models (`JevModel`): `jev-latest` (default alias, stable), `jev-preview`
58
+ (alias, newest build), `jev-1.13.0` (versioned). Text input only; 64k tokens
59
+ per request. Output tokens are free.
60
+
61
+ Registers itself with `LLMFactory` under the `jev` and `typesafe` provider
62
+ keys via the `parrot.clients` entry-point group.
@@ -0,0 +1,33 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77.0.0", "wheel>=0.44.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "ai-parrot-client-jev"
7
+ version = "0.2.5"
8
+ description = "TypeSafe AI System One (Jev) client for AI-Parrot (parrot.clients.jev)"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11,<3.14"
11
+ license = "MIT"
12
+ authors = [
13
+ {name = "Jesus Lara", email = "jesuslara@phenobarbital.info"}
14
+ ]
15
+ dependencies = [
16
+ "ai-parrot>=1.0.5",
17
+ # No vendor SDK: the official `typesafe-sdk` is built on httpx2, which the
18
+ # codebase conventions forbid. JevClient speaks the System One HTTP API
19
+ # (POST /v1/systemone) directly over aiohttp, with tenacity for retries —
20
+ # both already core ai-parrot base dependencies.
21
+ ]
22
+
23
+ [project.entry-points."parrot.clients"]
24
+ jev = "parrot.clients.jev:JevClient"
25
+ typesafe = "parrot.clients.jev:JevClient"
26
+
27
+ [tool.setuptools.packages.find]
28
+ where = ["src"]
29
+ include = ["parrot*"]
30
+ namespaces = true
31
+
32
+ [tool.uv.sources]
33
+ ai-parrot = { workspace = true }
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,72 @@
1
+ Metadata-Version: 2.4
2
+ Name: ai-parrot-client-jev
3
+ Version: 0.2.5
4
+ Summary: TypeSafe AI System One (Jev) client for AI-Parrot (parrot.clients.jev)
5
+ Author-email: Jesus Lara <jesuslara@phenobarbital.info>
6
+ License-Expression: MIT
7
+ Requires-Python: <3.14,>=3.11
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: ai-parrot>=1.0.5
10
+
11
+ # ai-parrot-client-jev
12
+
13
+ TypeSafe AI **System One** client satellite for
14
+ [AI-Parrot](https://github.com/phenobarbital/ai-parrot), targeting the
15
+ **Jev** model.
16
+
17
+ Jev is not a text generator: you send it *state* (a string or JSON document)
18
+ plus typed *questions* and it returns structured answers with calibrated
19
+ probabilities — a `choice` from a fixed set, a `score` on an ordered rubric,
20
+ or a `noul` (yes/no) probability. `parrot.clients.jev.JevClient` maps that
21
+ contract onto the `AbstractClient` interface:
22
+
23
+ - `ask(prompt, questions=...)` — the prompt (plus optional system prompt and
24
+ conversation history) becomes the state; the answers come back as an
25
+ `AIMessage` whose `output` / `structured_output` is a `SystemOneResponse`.
26
+ - `invoke(prompt, output_type=MyModel)` — a Pydantic model is translated into
27
+ questions (`bool` → noul, `Literal`/`Enum` → choice, `int`/`float` with
28
+ `criteria` levels → score) and the answers are validated back into it.
29
+ - `system_one(state, questions)` — the raw, typed API call.
30
+
31
+ ```bash
32
+ uv pip install ai-parrot-client-jev
33
+ export TYPESAFE_API_KEY=...
34
+ ```
35
+
36
+ ```python
37
+ from parrot.clients.jev import JevClient, Choice, Noul, Score
38
+
39
+ client = JevClient() # reads TYPESAFE_API_KEY; calls jev-latest by default
40
+ ticket = (
41
+ "Hi, I've been trying to connect my Stripe account for 3 days and it keeps "
42
+ "failing. I'm losing sales. Please help ASAP."
43
+ )
44
+ response = await client.system_one(
45
+ state=ticket,
46
+ questions={
47
+ "department": Choice(
48
+ instructions="Which team should handle this",
49
+ criteria={
50
+ "billing": "Payment or subscription issues",
51
+ "technical": "Bugs or integration problems",
52
+ "sales": "Pricing or account questions",
53
+ },
54
+ ),
55
+ "frustration": Score(
56
+ instructions="How frustrated the customer appears",
57
+ criteria=["Calm, just stating facts", "Frustrated but civil", "Very angry, strong language"],
58
+ ),
59
+ "is_urgent": Noul(instructions="The message conveys urgency or time-sensitivity"),
60
+ },
61
+ )
62
+ response.answers["department"].choice # "billing"
63
+ response.answers["frustration"].score # 1.035
64
+ response.answers["is_urgent"].noul # 0.999
65
+ ```
66
+
67
+ Models (`JevModel`): `jev-latest` (default alias, stable), `jev-preview`
68
+ (alias, newest build), `jev-1.13.0` (versioned). Text input only; 64k tokens
69
+ per request. Output tokens are free.
70
+
71
+ Registers itself with `LLMFactory` under the `jev` and `typesafe` provider
72
+ keys via the `parrot.clients` entry-point group.
@@ -0,0 +1,13 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/ai_parrot_client_jev.egg-info/PKG-INFO
4
+ src/ai_parrot_client_jev.egg-info/SOURCES.txt
5
+ src/ai_parrot_client_jev.egg-info/dependency_links.txt
6
+ src/ai_parrot_client_jev.egg-info/entry_points.txt
7
+ src/ai_parrot_client_jev.egg-info/requires.txt
8
+ src/ai_parrot_client_jev.egg-info/top_level.txt
9
+ src/parrot/clients/jev/__init__.py
10
+ src/parrot/clients/jev/client.py
11
+ src/parrot/clients/jev/exceptions.py
12
+ src/parrot/clients/jev/models.py
13
+ src/parrot/clients/jev/schema.py
@@ -0,0 +1,3 @@
1
+ [parrot.clients]
2
+ jev = parrot.clients.jev:JevClient
3
+ typesafe = parrot.clients.jev:JevClient
@@ -0,0 +1,64 @@
1
+ """TypeSafe AI System One (Jev) client for AI-Parrot."""
2
+
3
+ from .client import JevClient
4
+ from .exceptions import (
5
+ JevAPIError,
6
+ JevAuthenticationError,
7
+ JevBadRequestError,
8
+ JevConfigurationError,
9
+ JevConnectionError,
10
+ JevError,
11
+ JevNotFoundError,
12
+ JevRateLimitError,
13
+ JevSchemaError,
14
+ JevServerError,
15
+ )
16
+ from .models import (
17
+ MAX_REQUEST_TOKENS,
18
+ MAX_STATE_PLUS_QUESTION_TOKENS,
19
+ MODEL_ALIASES,
20
+ Choice,
21
+ ChoiceAnswer,
22
+ JevModel,
23
+ JevUsage,
24
+ ListModelsResponse,
25
+ ModelMetadata,
26
+ Noul,
27
+ NoulAnswer,
28
+ NoulCriteria,
29
+ Score,
30
+ ScoreAnswer,
31
+ SystemOneResponse,
32
+ )
33
+ from .schema import answers_to_type, questions_from_type
34
+
35
+ __all__ = [
36
+ "JevClient",
37
+ "JevModel",
38
+ "MODEL_ALIASES",
39
+ "MAX_REQUEST_TOKENS",
40
+ "MAX_STATE_PLUS_QUESTION_TOKENS",
41
+ "Choice",
42
+ "Noul",
43
+ "NoulCriteria",
44
+ "Score",
45
+ "ChoiceAnswer",
46
+ "NoulAnswer",
47
+ "ScoreAnswer",
48
+ "SystemOneResponse",
49
+ "JevUsage",
50
+ "ModelMetadata",
51
+ "ListModelsResponse",
52
+ "questions_from_type",
53
+ "answers_to_type",
54
+ "JevError",
55
+ "JevAPIError",
56
+ "JevAuthenticationError",
57
+ "JevBadRequestError",
58
+ "JevConfigurationError",
59
+ "JevConnectionError",
60
+ "JevNotFoundError",
61
+ "JevRateLimitError",
62
+ "JevSchemaError",
63
+ "JevServerError",
64
+ ]