isaacus 0.10.1__py3-none-any.whl → 0.12.0__py3-none-any.whl

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 (38) hide show
  1. isaacus/_version.py +1 -1
  2. isaacus/resources/classifications/universal.py +8 -8
  3. isaacus/resources/embeddings.py +24 -24
  4. isaacus/resources/enrichments.py +2 -2
  5. isaacus/resources/extractions/__init__.py +12 -12
  6. isaacus/resources/extractions/extractions.py +18 -18
  7. isaacus/resources/extractions/qa.py +29 -29
  8. isaacus/resources/rerankings.py +12 -12
  9. isaacus/types/__init__.py +14 -0
  10. isaacus/types/classifications/universal_classification_response.py +22 -22
  11. isaacus/types/classifications/universal_create_params.py +6 -6
  12. isaacus/types/embedding_create_params.py +11 -11
  13. isaacus/types/embedding_response.py +3 -3
  14. isaacus/types/enrichment_create_params.py +1 -1
  15. isaacus/types/enrichment_response.py +6 -1404
  16. isaacus/types/extractions/__init__.py +1 -1
  17. isaacus/types/extractions/answer_extraction_response.py +12 -12
  18. isaacus/types/extractions/qa_create_params.py +8 -8
  19. isaacus/types/ilgs_v1_crossreference.py +42 -0
  20. isaacus/types/ilgs_v1_date.py +70 -0
  21. isaacus/types/ilgs_v1_document.py +172 -0
  22. isaacus/types/ilgs_v1_email.py +27 -0
  23. isaacus/types/ilgs_v1_external_document.py +101 -0
  24. isaacus/types/ilgs_v1_id_number.py +27 -0
  25. isaacus/types/ilgs_v1_location.py +53 -0
  26. isaacus/types/ilgs_v1_person.py +195 -0
  27. isaacus/types/ilgs_v1_phone_number.py +30 -0
  28. isaacus/types/ilgs_v1_quote.py +52 -0
  29. isaacus/types/ilgs_v1_segment.py +205 -0
  30. isaacus/types/ilgs_v1_span.py +28 -0
  31. isaacus/types/ilgs_v1_term.py +59 -0
  32. isaacus/types/ilgs_v1_website.py +28 -0
  33. isaacus/types/reranking_create_params.py +7 -7
  34. {isaacus-0.10.1.dist-info → isaacus-0.12.0.dist-info}/METADATA +1 -1
  35. isaacus-0.12.0.dist-info/RECORD +70 -0
  36. isaacus-0.10.1.dist-info/RECORD +0 -56
  37. {isaacus-0.10.1.dist-info → isaacus-0.12.0.dist-info}/WHEEL +0 -0
  38. {isaacus-0.10.1.dist-info → isaacus-0.12.0.dist-info}/licenses/LICENSE +0 -0
@@ -8,13 +8,6 @@ __all__ = ["UniversalClassificationResponse", "Classification", "ClassificationC
8
8
 
9
9
 
10
10
  class ClassificationChunk(BaseModel):
11
- end: int
12
- """
13
- The index of the character immediately after the last character of the chunk in
14
- the original text, beginning from `0` (such that, in Python, the chunk is
15
- equivalent to `text[start:end]`).
16
- """
17
-
18
11
  index: int
19
12
  """
20
13
  The original position of the chunk in the outputted list of chunks before
@@ -22,6 +15,19 @@ class ClassificationChunk(BaseModel):
22
15
  `1`).
23
16
  """
24
17
 
18
+ start: int
19
+ """
20
+ The index of the character in the original text where the chunk starts,
21
+ beginning from `0`.
22
+ """
23
+
24
+ end: int
25
+ """
26
+ The index of the character immediately after the last character of the chunk in
27
+ the original text, beginning from `0` (such that, in Python, the chunk is
28
+ equivalent to `text[start:end]`).
29
+ """
30
+
25
31
  score: float
26
32
  """
27
33
  The model's score of the likelihood that the query expressed about the chunk is
@@ -31,26 +37,11 @@ class ClassificationChunk(BaseModel):
31
37
  score less than `0.5` indicates that the chunk does not support the query.
32
38
  """
33
39
 
34
- start: int
35
- """
36
- The index of the character in the original text where the chunk starts,
37
- beginning from `0`.
38
- """
39
-
40
40
  text: str
41
41
  """The text of the chunk."""
42
42
 
43
43
 
44
44
  class Classification(BaseModel):
45
- chunks: Optional[List[ClassificationChunk]] = None
46
- """
47
- The text as broken into chunks by
48
- [semchunk](https://github.com/isaacus-dev/semchunk), each chunk with its own
49
- confidence score, ordered from highest to lowest score.
50
-
51
- If no chunking occurred, this will be `null`.
52
- """
53
-
54
45
  index: int
55
46
  """
56
47
  The index of the text in the input array of texts, starting from `0` (and,
@@ -66,6 +57,15 @@ class Classification(BaseModel):
66
57
  score less than `0.5` indicates that the text does not support the query.
67
58
  """
68
59
 
60
+ chunks: Optional[List[ClassificationChunk]] = None
61
+ """
62
+ The text as broken into chunks by
63
+ [semchunk](https://github.com/isaacus-dev/semchunk), each chunk with its own
64
+ confidence score, ordered from highest to lowest score.
65
+
66
+ If no chunking occurred, this will be `null`.
67
+ """
68
+
69
69
 
70
70
  class Usage(BaseModel):
71
71
  """Statistics about the usage of resources in the process of classifying the text."""
@@ -34,9 +34,6 @@ class UniversalCreateParams(TypedDict, total=False):
34
34
  Each text must contain at least one non-whitespace character.
35
35
  """
36
36
 
37
- chunking_options: Optional[ChunkingOptions]
38
- """Options for how to split text into smaller chunks."""
39
-
40
37
  is_iql: bool
41
38
  """
42
39
  Whether the query should be interpreted as an
@@ -57,15 +54,18 @@ class UniversalCreateParams(TypedDict, total=False):
57
54
  `chunk_min` uses the lowest confidence score of all of the texts' chunks.
58
55
  """
59
56
 
57
+ chunking_options: Optional[ChunkingOptions]
58
+ """Options for how to split text into smaller chunks."""
59
+
60
60
 
61
61
  class ChunkingOptions(TypedDict, total=False):
62
62
  """Options for how to split text into smaller chunks."""
63
63
 
64
+ size: Optional[int]
65
+ """A whole number greater than or equal to 1."""
66
+
64
67
  overlap_ratio: Optional[float]
65
68
  """A number greater than or equal to 0 and less than 1."""
66
69
 
67
70
  overlap_tokens: Optional[int]
68
71
  """A whole number greater than or equal to 0."""
69
-
70
- size: Optional[int]
71
- """A whole number greater than or equal to 1."""
@@ -25,8 +25,15 @@ class EmbeddingCreateParams(TypedDict, total=False):
25
25
  No more than 128 texts can be embedded in a single request.
26
26
  """
27
27
 
28
- dimensions: Optional[int]
29
- """A whole number greater than or equal to 1."""
28
+ task: Optional[Literal["retrieval/query", "retrieval/document"]]
29
+ """The task the embeddings will be used for.
30
+
31
+ `retrieval/query` is meant for queries and statements, and `retrieval/document`
32
+ is meant for anything to be retrieved using query embeddings.
33
+
34
+ If `null`, which is the default setting, embeddings will not be optimized for
35
+ any particular task.
36
+ """
30
37
 
31
38
  overflow_strategy: Optional[Literal["drop_end"]]
32
39
  """The strategy to employ when content exceeds the model's maximum input length.
@@ -38,12 +45,5 @@ class EmbeddingCreateParams(TypedDict, total=False):
38
45
  input length.
39
46
  """
40
47
 
41
- task: Optional[Literal["retrieval/query", "retrieval/document"]]
42
- """The task the embeddings will be used for.
43
-
44
- `retrieval/query` is meant for queries and statements, and `retrieval/document`
45
- is meant for anything to be retrieved using query embeddings.
46
-
47
- If `null`, which is the default setting, embeddings will not be optimized for
48
- any particular task.
49
- """
48
+ dimensions: Optional[int]
49
+ """A whole number greater than or equal to 1."""
@@ -8,15 +8,15 @@ __all__ = ["EmbeddingResponse", "Embedding", "Usage"]
8
8
 
9
9
 
10
10
  class Embedding(BaseModel):
11
- embedding: List[float]
12
- """The embedding of the content represented as an array of floating point numbers."""
13
-
14
11
  index: int
15
12
  """
16
13
  The position of the content in the input array of contents, starting from `0`
17
14
  (and, therefore, ending at the number of contents minus `1`).
18
15
  """
19
16
 
17
+ embedding: List[float]
18
+ """The embedding of the content represented as an array of floating point numbers."""
19
+
20
20
 
21
21
  class Usage(BaseModel):
22
22
  """Statistics about the usage of resources in the process of embedding the inputs."""
@@ -11,7 +11,7 @@ __all__ = ["EnrichmentCreateParams"]
11
11
 
12
12
 
13
13
  class EnrichmentCreateParams(TypedDict, total=False):
14
- model: Required[Literal["kanon-2-enricher-preview"]]
14
+ model: Required[Literal["kanon-2-enricher"]]
15
15
  """
16
16
  The ID of the [model](https://docs.isaacus.com/models#enrichment) to use for
17
17
  enrichment.