alita-sdk 0.3.268__py3-none-any.whl → 0.3.270__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.
- alita_sdk/runtime/tools/vectorstore.py +12 -5
- alita_sdk/tools/figma/api_wrapper.py +1 -1
- {alita_sdk-0.3.268.dist-info → alita_sdk-0.3.270.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.268.dist-info → alita_sdk-0.3.270.dist-info}/RECORD +7 -7
- {alita_sdk-0.3.268.dist-info → alita_sdk-0.3.270.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.268.dist-info → alita_sdk-0.3.270.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.268.dist-info → alita_sdk-0.3.270.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
import json
|
2
2
|
import math
|
3
3
|
import types
|
4
|
-
from typing import Any, Optional, List, Dict, Callable, Generator
|
4
|
+
from typing import Any, Optional, List, Dict, Callable, Generator, OrderedDict
|
5
5
|
|
6
6
|
from langchain_core.documents import Document
|
7
7
|
from pydantic import BaseModel, model_validator, Field
|
@@ -542,11 +542,18 @@ class VectorStoreWrapper(BaseToolApiWrapper):
|
|
542
542
|
|
543
543
|
# Initialize document map for tracking by ID
|
544
544
|
doc_map = {
|
545
|
-
|
546
|
-
|
547
|
-
|
545
|
+
(
|
546
|
+
f"{doc.metadata.get('id', f'idx_{i}')}_{doc.metadata['chunk_id']}"
|
547
|
+
if 'chunk_id' in doc.metadata
|
548
|
+
else doc.metadata.get('id', f"idx_{i}")
|
549
|
+
): (doc, 1 - score)
|
548
550
|
for i, (doc, score) in enumerate(vector_items)
|
549
551
|
}
|
552
|
+
|
553
|
+
# Sort the items by the new score in descending order
|
554
|
+
doc_map = OrderedDict(
|
555
|
+
sorted(doc_map.items(), key=lambda x: x[1][1], reverse=True)
|
556
|
+
)
|
550
557
|
|
551
558
|
# Process full-text search if configured
|
552
559
|
if full_text_search and full_text_search.get('enabled') and full_text_search.get('fields'):
|
@@ -597,7 +604,7 @@ class VectorStoreWrapper(BaseToolApiWrapper):
|
|
597
604
|
# Apply cutoff filter
|
598
605
|
if cut_off:
|
599
606
|
# Filter out items above the cutoff score (since the lower the score, the better)
|
600
|
-
combined_items = [item for item in combined_items if abs(item[1])
|
607
|
+
combined_items = [item for item in combined_items if abs(item[1]) >= cut_off]
|
601
608
|
|
602
609
|
# Sort by score and limit results
|
603
610
|
# DISABLED: for chroma we want ascending order (lower score is better), for others descending
|
@@ -297,7 +297,7 @@ class FigmaApiWrapper(BaseVectorStoreToolApiWrapper):
|
|
297
297
|
description="ID of the project to list files from: i.e. '55391681'",
|
298
298
|
default=None)),
|
299
299
|
'file_keys': (Optional[List[str]], Field(
|
300
|
-
description=
|
300
|
+
description='List of file keys to index: i.e. ["Fp24FuzPwH0L74ODSrCnQo", "jmhAr6q78dJoMRqt48zisY"]',
|
301
301
|
default=None))
|
302
302
|
}
|
303
303
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: alita_sdk
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.270
|
4
4
|
Summary: SDK for building langchain agents using resources from Alita
|
5
5
|
Author-email: Artem Rozumenko <artyom.rozumenko@gmail.com>, Mikalai Biazruchka <mikalai_biazruchka@epam.com>, Roman Mitusov <roman_mitusov@epam.com>, Ivan Krakhmaliuk <lifedjik@gmail.com>, Artem Dubrovskiy <ad13box@gmail.com>
|
6
6
|
License-Expression: Apache-2.0
|
@@ -107,7 +107,7 @@ alita_sdk/runtime/tools/pgvector_search.py,sha256=NN2BGAnq4SsDHIhUcFZ8d_dbEOM8Qw
|
|
107
107
|
alita_sdk/runtime/tools/prompt.py,sha256=nJafb_e5aOM1Rr3qGFCR-SKziU9uCsiP2okIMs9PppM,741
|
108
108
|
alita_sdk/runtime/tools/router.py,sha256=wCvZjVkdXK9dMMeEerrgKf5M790RudH68pDortnHSz0,1517
|
109
109
|
alita_sdk/runtime/tools/tool.py,sha256=lE1hGi6qOAXG7qxtqxarD_XMQqTghdywf261DZawwno,5631
|
110
|
-
alita_sdk/runtime/tools/vectorstore.py,sha256=
|
110
|
+
alita_sdk/runtime/tools/vectorstore.py,sha256=UyuNQwsGRcZMz5M3olUwahxtTBN8yvd2D4yeGWh-HWk,35014
|
111
111
|
alita_sdk/runtime/tools/vectorstore_base.py,sha256=Hxd74XNiuxsc6Fe9CufTrLATWUPnm5278t0a-1YswR8,27638
|
112
112
|
alita_sdk/runtime/utils/AlitaCallback.py,sha256=E4LlSBuCHWiUq6W7IZExERHZY0qcmdjzc_rJlF2iQIw,7356
|
113
113
|
alita_sdk/runtime/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -222,7 +222,7 @@ alita_sdk/tools/custom_open_api/api_wrapper.py,sha256=sDSFpvEqpSvXHGiBISdQQcUecf
|
|
222
222
|
alita_sdk/tools/elastic/__init__.py,sha256=iwnSRppRpzvJ1da2K3Glu8Uu41MhBDCYbguboLkEbW0,2818
|
223
223
|
alita_sdk/tools/elastic/api_wrapper.py,sha256=pl8CqQxteJAGwyOhMcld-ZgtOTFwwbv42OITQVe8rM0,1948
|
224
224
|
alita_sdk/tools/figma/__init__.py,sha256=t88TwHfm3EuVVA3H1u8UYBPOj5sAvRSO1nHYj40cyV4,4420
|
225
|
-
alita_sdk/tools/figma/api_wrapper.py,sha256=
|
225
|
+
alita_sdk/tools/figma/api_wrapper.py,sha256=6AMpsNVxa5QnkI35P85SIYuV1YjMlFC_vsa31EW9feU,20560
|
226
226
|
alita_sdk/tools/github/__init__.py,sha256=oqxXWa9ekBHsORksllCx2EbVcEDRCYdxCA4ir0tXzAc,5124
|
227
227
|
alita_sdk/tools/github/api_wrapper.py,sha256=uDwYckdnpYRJtb0uZnDkaz2udvdDLVxuCh1tSwspsiU,8411
|
228
228
|
alita_sdk/tools/github/github_client.py,sha256=nxnSXsDul2PPbWvYZS8TmAFFmR-5ALyakNoV5LN2D4U,86617
|
@@ -336,8 +336,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=HOt9ShtJI_1tVPcwd3Rwk-VS0SMLq
|
|
336
336
|
alita_sdk/tools/zephyr_squad/__init__.py,sha256=0AI_j27xVO5Gk5HQMFrqPTd4uvuVTpiZUicBrdfEpKg,2796
|
337
337
|
alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=kmw_xol8YIYFplBLWTqP_VKPRhL_1ItDD0_vXTe_UuI,14906
|
338
338
|
alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=R371waHsms4sllHCbijKYs90C-9Yu0sSR3N4SUfQOgU,5066
|
339
|
-
alita_sdk-0.3.
|
340
|
-
alita_sdk-0.3.
|
341
|
-
alita_sdk-0.3.
|
342
|
-
alita_sdk-0.3.
|
343
|
-
alita_sdk-0.3.
|
339
|
+
alita_sdk-0.3.270.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
340
|
+
alita_sdk-0.3.270.dist-info/METADATA,sha256=Rew1TSCOcM5Yz0OLl0kJBMaQcOg6EDbGP9CFfF3U2Ko,18897
|
341
|
+
alita_sdk-0.3.270.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
342
|
+
alita_sdk-0.3.270.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
|
343
|
+
alita_sdk-0.3.270.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|