openaivec 0.13.6__py3-none-any.whl → 0.13.7__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.
- openaivec/__init__.py +7 -2
- openaivec/di.py +2 -0
- openaivec/log.py +1 -1
- openaivec/model.py +4 -0
- openaivec/optimize.py +3 -1
- openaivec/pandas_ext.py +7 -0
- openaivec/provider.py +2 -0
- openaivec/proxy.py +2 -0
- openaivec/serialize.py +1 -1
- openaivec/spark.py +9 -0
- openaivec/util.py +2 -0
- {openaivec-0.13.6.dist-info → openaivec-0.13.7.dist-info}/METADATA +1 -1
- {openaivec-0.13.6.dist-info → openaivec-0.13.7.dist-info}/RECORD +15 -15
- {openaivec-0.13.6.dist-info → openaivec-0.13.7.dist-info}/WHEEL +0 -0
- {openaivec-0.13.6.dist-info → openaivec-0.13.7.dist-info}/licenses/LICENSE +0 -0
openaivec/__init__.py
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
from .embeddings import AsyncBatchEmbeddings, BatchEmbeddings
|
|
2
|
+
from .model import PreparedTask
|
|
3
|
+
from .prompt import FewShotPrompt, FewShotPromptBuilder
|
|
2
4
|
from .responses import AsyncBatchResponses, BatchResponses
|
|
3
5
|
|
|
4
6
|
__all__ = [
|
|
5
|
-
"
|
|
7
|
+
"AsyncBatchEmbeddings",
|
|
6
8
|
"AsyncBatchResponses",
|
|
7
9
|
"BatchEmbeddings",
|
|
8
|
-
"
|
|
10
|
+
"BatchResponses",
|
|
11
|
+
"FewShotPrompt",
|
|
12
|
+
"FewShotPromptBuilder",
|
|
13
|
+
"PreparedTask",
|
|
9
14
|
]
|
openaivec/di.py
CHANGED
|
@@ -2,6 +2,8 @@ from dataclasses import dataclass, field
|
|
|
2
2
|
from threading import RLock
|
|
3
3
|
from typing import Any, Callable, Dict, Set, Type, TypeVar
|
|
4
4
|
|
|
5
|
+
__all__ = []
|
|
6
|
+
|
|
5
7
|
"""Simple dependency injection container with singleton lifecycle management.
|
|
6
8
|
|
|
7
9
|
This module provides a lightweight dependency injection container that manages
|
openaivec/log.py
CHANGED
openaivec/model.py
CHANGED
openaivec/optimize.py
CHANGED
|
@@ -5,6 +5,8 @@ from dataclasses import dataclass, field
|
|
|
5
5
|
from datetime import datetime, timezone
|
|
6
6
|
from typing import List
|
|
7
7
|
|
|
8
|
+
__all__ = []
|
|
9
|
+
|
|
8
10
|
|
|
9
11
|
@dataclass(frozen=True)
|
|
10
12
|
class PerformanceMetric:
|
|
@@ -20,7 +22,7 @@ class BatchSizeSuggester:
|
|
|
20
22
|
min_batch_size: int = 10
|
|
21
23
|
min_duration: float = 30.0
|
|
22
24
|
max_duration: float = 60.0
|
|
23
|
-
step_ratio: float = 0.
|
|
25
|
+
step_ratio: float = 0.2
|
|
24
26
|
sample_size: int = 4
|
|
25
27
|
_history: List[PerformanceMetric] = field(default_factory=list)
|
|
26
28
|
_lock: threading.RLock = field(default_factory=threading.RLock, repr=False)
|
openaivec/pandas_ext.py
CHANGED
|
@@ -48,6 +48,13 @@ import numpy as np
|
|
|
48
48
|
import pandas as pd
|
|
49
49
|
import tiktoken
|
|
50
50
|
from openai import AsyncOpenAI, OpenAI
|
|
51
|
+
|
|
52
|
+
__all__ = [
|
|
53
|
+
"embeddings_model",
|
|
54
|
+
"responses_model",
|
|
55
|
+
"use",
|
|
56
|
+
"use_async",
|
|
57
|
+
]
|
|
51
58
|
from pydantic import BaseModel
|
|
52
59
|
|
|
53
60
|
from openaivec.embeddings import AsyncBatchEmbeddings, BatchEmbeddings
|
openaivec/provider.py
CHANGED
openaivec/proxy.py
CHANGED
openaivec/serialize.py
CHANGED
|
@@ -29,7 +29,7 @@ from typing import Any, Dict, List, Literal, Type
|
|
|
29
29
|
|
|
30
30
|
from pydantic import BaseModel, Field, create_model
|
|
31
31
|
|
|
32
|
-
__all__ = [
|
|
32
|
+
__all__ = []
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
def serialize_base_model(obj: Type[BaseModel]) -> Dict[str, Any]:
|
openaivec/spark.py
CHANGED
|
@@ -12,6 +12,15 @@ improved performance in I/O-bound operations.
|
|
|
12
12
|
automatically cache duplicate inputs within each partition, significantly reducing
|
|
13
13
|
API calls and costs when processing datasets with overlapping content.
|
|
14
14
|
|
|
15
|
+
__all__ = [
|
|
16
|
+
"count_tokens_udf",
|
|
17
|
+
"embeddings_udf",
|
|
18
|
+
"responses_udf",
|
|
19
|
+
"similarity_udf",
|
|
20
|
+
"split_to_chunks_udf",
|
|
21
|
+
"task_udf",
|
|
22
|
+
]
|
|
23
|
+
|
|
15
24
|
## Setup
|
|
16
25
|
|
|
17
26
|
First, obtain a Spark session and configure authentication:
|
openaivec/util.py
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
openaivec/__init__.py,sha256=
|
|
2
|
-
openaivec/di.py,sha256=
|
|
1
|
+
openaivec/__init__.py,sha256=2nPIsylGgJcBXgrKrGzuThgw0Ycajlvf-bSzSCtg_ng,393
|
|
2
|
+
openaivec/di.py,sha256=DsVeD-IJuAF3HS2OtHtQJ0BtWXyqzZeeNi7LDMWO3W0,10648
|
|
3
3
|
openaivec/embeddings.py,sha256=ntnsdV2L6WAT4nKqgL3MZfhqf_Xnfu_J8oFavjIVcIU,7470
|
|
4
|
-
openaivec/log.py,sha256=
|
|
5
|
-
openaivec/model.py,sha256=
|
|
6
|
-
openaivec/optimize.py,sha256
|
|
7
|
-
openaivec/pandas_ext.py,sha256=
|
|
4
|
+
openaivec/log.py,sha256=1qhc9CF4D4bwiF_VWHilcYBPcTqIKyI0zuNEfn0MLNA,1430
|
|
5
|
+
openaivec/model.py,sha256=xg3s9Ljqb2xK1t_a5bwWxGJfFSIuaNrFGMgQq4nQKrM,3351
|
|
6
|
+
openaivec/optimize.py,sha256=-mKjD5YV_d1Z2nqfGfAcmx6mTKn6AODjFTrIKJPbAXQ,3851
|
|
7
|
+
openaivec/pandas_ext.py,sha256=bvAG_2Uf39iNOAn4lSRXO63LoaMEI1J6t8kRSy_LK40,58807
|
|
8
8
|
openaivec/prompt.py,sha256=ZzHOS2CRLRtPeP4Z734xkaAA5LFcfmhkDQE5URQUidQ,20842
|
|
9
|
-
openaivec/provider.py,sha256=
|
|
10
|
-
openaivec/proxy.py,sha256=
|
|
9
|
+
openaivec/provider.py,sha256=sEPf3g9Lhq66PaoEkpJdOVd9yG_PTCW3BU_qYuvZFjQ,6702
|
|
10
|
+
openaivec/proxy.py,sha256=1evFOBifsn4Ecf-3GcFeQjt_dHlSV0iC6gxs-QjMCHk,28915
|
|
11
11
|
openaivec/responses.py,sha256=v4MtyIh_g6bahmkq1Ra4y63Tlqg6-Ace1SErmoosvMg,21424
|
|
12
|
-
openaivec/serialize.py,sha256=
|
|
13
|
-
openaivec/spark.py,sha256=
|
|
14
|
-
openaivec/util.py,sha256=
|
|
12
|
+
openaivec/serialize.py,sha256=mSuSVfSpXMnsFZ4JjlOEe5b22ttBUHviPs9mF99lf0A,7277
|
|
13
|
+
openaivec/spark.py,sha256=sBD4fiX-4ejf_m0SCWgv_e-aGptCwyuQ4FfvnxlT09g,24399
|
|
14
|
+
openaivec/util.py,sha256=dFWwjouJyvF-tqNPs2933OAt5Fw9I2Q2BvmGIfGH5k4,6423
|
|
15
15
|
openaivec/task/__init__.py,sha256=26Kd2eRRfUqRJnYH83sRrbuEuRwshypRRSkTWtT50Tw,6177
|
|
16
16
|
openaivec/task/customer_support/__init__.py,sha256=KWfGyXPdZyfGdRH17x7hPpJJ1N2EP9PPhZx0fvBAwSI,884
|
|
17
17
|
openaivec/task/customer_support/customer_sentiment.py,sha256=vf2GzUk_06JD1FeRTetg5bCcBFUSqH349J1TI5lsgkg,7616
|
|
@@ -29,7 +29,7 @@ openaivec/task/nlp/sentiment_analysis.py,sha256=9HdMpi7FkjHNXAswaN98k8jeKsatBBXT
|
|
|
29
29
|
openaivec/task/nlp/translation.py,sha256=4fjKtbVvOvivWMrpZfreIsdg8d0DplDujO8kAdLbAKI,6625
|
|
30
30
|
openaivec/task/table/__init__.py,sha256=kJz15WDJXjyC7UIHKBvlTRhCf347PCDMH5T5fONV2sU,83
|
|
31
31
|
openaivec/task/table/fillna.py,sha256=vi8t5QEIU-W3e05wwpATb3MEUDyf8luVnE8U-5VebZo,6582
|
|
32
|
-
openaivec-0.13.
|
|
33
|
-
openaivec-0.13.
|
|
34
|
-
openaivec-0.13.
|
|
35
|
-
openaivec-0.13.
|
|
32
|
+
openaivec-0.13.7.dist-info/METADATA,sha256=4_OtOhijWBx952u7owZwpsf3S5MtPsieGVo3s5v_v7w,27566
|
|
33
|
+
openaivec-0.13.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
34
|
+
openaivec-0.13.7.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
|
|
35
|
+
openaivec-0.13.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|