personal_knowledge_library 3.3.0__py3-none-any.whl → 3.3.2__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.

Potentially problematic release.


This version of personal_knowledge_library might be problematic. Click here for more details.

knowledge/__init__.py CHANGED
@@ -17,7 +17,7 @@ __license__ = "Wacom"
17
17
  __maintainer__ = ["Markus Weber"]
18
18
  __email__ = "markus.weber@wacom.com"
19
19
  __status__ = "beta"
20
- __version__ = "3.3.0"
20
+ __version__ = "3.3.2"
21
21
 
22
22
  import loguru
23
23
 
@@ -1797,7 +1797,7 @@ class AsyncWacomKnowledgeService(AsyncServiceAPIClient):
1797
1797
  content_link="",
1798
1798
  ontology_types=entity_types,
1799
1799
  entity_type=EntityType.PERSONAL_ENTITY,
1800
- tokens=e.get("token"),
1800
+ tokens=e.get("tokens"),
1801
1801
  token_indexes=e.get("tokenIndexes"),
1802
1802
  )
1803
1803
  ne.relevant_type = OntologyClassReference.parse(e["type"])
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Copyright © 2024 Wacom. All rights reserved.
3
3
  import asyncio
4
- from typing import Dict, Any, Optional, List
4
+ from typing import Dict, Any, Optional, List, Literal
5
5
 
6
6
  import orjson
7
7
 
@@ -333,6 +333,7 @@ class AsyncSemanticSearchClient(AsyncServiceAPIClient):
333
333
  locale: str,
334
334
  filters: Optional[Dict[str, Any]] = None,
335
335
  max_results: int = 10,
336
+ filter_mode: Optional[Literal["AND", "OR"]] = None,
336
337
  auth_key: Optional[str] = None,
337
338
  ) -> DocumentSearchResponse:
338
339
  """
@@ -348,6 +349,8 @@ class AsyncSemanticSearchClient(AsyncServiceAPIClient):
348
349
  Filters for the search
349
350
  max_results: int
350
351
  Maximum number of results
352
+ filter_mode: Optional[Literal["AND", "OR"]] = None
353
+ Filter mode for the search. If None is provided, the default is "AND".
351
354
  auth_key: Optional[str] (Default:= None)
352
355
  If the auth key is set the logged-in user (if any) will be ignored and the auth key will be used.
353
356
 
@@ -375,6 +378,8 @@ class AsyncSemanticSearchClient(AsyncServiceAPIClient):
375
378
  "locale": locale,
376
379
  "max_results": max_results,
377
380
  }
381
+ if filter_mode:
382
+ params["filter_mode"] = filter_mode
378
383
  async with self.__async_session__() as session:
379
384
  async with session.post(url, headers=headers, json=params) as response:
380
385
  if response.ok:
@@ -390,6 +395,7 @@ class AsyncSemanticSearchClient(AsyncServiceAPIClient):
390
395
  locale: str,
391
396
  filters: Optional[Dict[str, Any]] = None,
392
397
  max_results: int = 10,
398
+ filter_mode: Optional[Literal["AND", "OR"]] = None,
393
399
  auth_key: Optional[str] = None,
394
400
  ) -> LabelMatchingResponse:
395
401
  """
@@ -405,6 +411,8 @@ class AsyncSemanticSearchClient(AsyncServiceAPIClient):
405
411
  Filters for the search
406
412
  max_results: int
407
413
  Maximum number of results
414
+ filter_mode: Optional[Literal["AND", "OR"]] = None
415
+ Filter mode for the search. If None is provided, the default is "AND".
408
416
  auth_key: Optional[str] (Default:= None)
409
417
  If the auth key is set the logged-in user (if any) will be ignored and the auth key will be used.
410
418
 
@@ -427,6 +435,8 @@ class AsyncSemanticSearchClient(AsyncServiceAPIClient):
427
435
  "locale": locale,
428
436
  "max_results": max_results,
429
437
  }
438
+ if filter_mode:
439
+ params["filter_mode"] = filter_mode
430
440
  async with self.__async_session__() as session:
431
441
  async with session.post(url, headers=headers, json=params) as response:
432
442
  if response.ok:
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Copyright © 2024-present Wacom. All rights reserved.
3
- from typing import Dict, Any, Optional, List
3
+ from typing import Dict, Any, Optional, List, Literal
4
4
 
5
5
  import requests
6
6
  from requests.adapters import HTTPAdapter
@@ -373,6 +373,7 @@ class SemanticSearchClient(WacomServiceAPIClient):
373
373
  locale: LocaleCode,
374
374
  filters: Optional[Dict[str, Any]] = None,
375
375
  max_results: int = 10,
376
+ filter_mode: Optional[Literal["AND", "OR"]] = None,
376
377
  max_retries: int = 3,
377
378
  backoff_factor: float = 0.1,
378
379
  auth_key: Optional[str] = None,
@@ -390,6 +391,8 @@ class SemanticSearchClient(WacomServiceAPIClient):
390
391
  Filters for the search
391
392
  max_results: int
392
393
  Maximum number of results
394
+ filter_mode: Optional[Literal["AND", "OR"]] = None
395
+ Filter mode for the search. If None is provided, the default is "AND".
393
396
  max_retries: int
394
397
  Maximum number of retries
395
398
  backoff_factor: float
@@ -421,6 +424,8 @@ class SemanticSearchClient(WacomServiceAPIClient):
421
424
  "locale": locale,
422
425
  "max_results": max_results,
423
426
  }
427
+ if filter_mode:
428
+ params["filter_mode"] = filter_mode
424
429
  mount_point: str = "https://" if self.service_url.startswith("https") else "http://"
425
430
  with requests.Session() as session:
426
431
  retries: Retry = Retry(total=max_retries, backoff_factor=backoff_factor, status_forcelist=STATUS_FORCE_LIST)
@@ -436,6 +441,7 @@ class SemanticSearchClient(WacomServiceAPIClient):
436
441
  query: str,
437
442
  locale: LocaleCode,
438
443
  filters: Optional[Dict[str, Any]] = None,
444
+ filter_mode: Optional[Literal["AND", "OR"]] = None,
439
445
  max_results: int = 10,
440
446
  max_retries: int = 3,
441
447
  backoff_factor: float = 0.1,
@@ -454,6 +460,8 @@ class SemanticSearchClient(WacomServiceAPIClient):
454
460
  Filters for the search
455
461
  max_results: int
456
462
  Maximum number of results
463
+ filter_mode: Optional[Literal["AND", "OR"]] = None
464
+ Filter mode for the search. If None is provided, the default is "AND".
457
465
  max_retries: int
458
466
  Maximum number of retries
459
467
  backoff_factor: float
@@ -480,6 +488,8 @@ class SemanticSearchClient(WacomServiceAPIClient):
480
488
  "locale": locale,
481
489
  "max_results": max_results,
482
490
  }
491
+ if filter_mode:
492
+ params["filter_mode"] = filter_mode
483
493
  mount_point: str = "https://" if self.service_url.startswith("https") else "http://"
484
494
  with requests.Session() as session:
485
495
  retries: Retry = Retry(total=max_retries, backoff_factor=backoff_factor, status_forcelist=STATUS_FORCE_LIST)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: personal_knowledge_library
3
- Version: 3.3.0
3
+ Version: 3.3.2
4
4
  Summary: Library to access Wacom's Personal Knowledge graph.
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -1,4 +1,4 @@
1
- knowledge/__init__.py,sha256=GRwtZsuLOUMj3OElzD5iDRR2A0q7EdiQ-Uu34AgELtw,2680
1
+ knowledge/__init__.py,sha256=flQ1lRI4EvDr7UK_m3TSu6wMprmvVNFrhVlnzMFv3WY,2680
2
2
  knowledge/base/__init__.py,sha256=rgAcl0azO6eoVk1gK9z0UFNlTHj3AN88k6LG-GdATFk,1079
3
3
  knowledge/base/access.py,sha256=BSh-6QbeHOCu55XTxA-p3DwEyRzgtN8TSxtcn6UvmZo,4411
4
4
  knowledge/base/entity.py,sha256=b-Ana_H_WI2-AT_n-V_HzUL6W9Ri16DcZFS3q4ziI94,8445
@@ -21,16 +21,16 @@ knowledge/public/wikidata.py,sha256=LwMP2kq2mH5Oi9JhPvG8lN9pZMDlQvxgaZgQKQO3kaM,
21
21
  knowledge/services/__init__.py,sha256=Pg4Pd9cCRiQ4-v3E0WCqldOhJFcMmkZrQHA7BY1Z1K8,3604
22
22
  knowledge/services/asyncio/__init__.py,sha256=dq9yGTxg_hoQb8E1kEtY4AeB8zrdJfw3-XlPoYn2j5U,225
23
23
  knowledge/services/asyncio/base.py,sha256=im6J1CWOp1N1tt6WdJ1uU0R-VFpvdYc6lZu8TyPrU5A,16222
24
- knowledge/services/asyncio/graph.py,sha256=9ZNNJvWKKYxyJBdTOxpx1Y3Iu1NzI6bdDDbKmgld4CU,74143
24
+ knowledge/services/asyncio/graph.py,sha256=XLVqDli8-Nr92MuLUKvHDisSqqca3fxg6e3_O0HC_2o,74144
25
25
  knowledge/services/asyncio/group.py,sha256=UKbk8vnPqqAkuc5gAd6g3IVOKmUJNqG2lreZM0O-hRg,18356
26
- knowledge/services/asyncio/search.py,sha256=fm1j6fJDQx831B82bqmZ3czYrYH3qtPCYlisSF26M5g,16217
26
+ knowledge/services/asyncio/search.py,sha256=DMxcevIM_pd6HF2_JTdva7t_zVUdSg5PbjJ8rPkBHi4,16774
27
27
  knowledge/services/asyncio/users.py,sha256=NJ7xagjr4gF6yKJXdwa0bz0eaYlQDee5RCEpfQJEHWk,10274
28
28
  knowledge/services/base.py,sha256=PdHfObShUBpbAS71LBhe5jOA13Y1JXbUkhRi9op8wis,18018
29
29
  knowledge/services/graph.py,sha256=hMGFomueC7lOr7-PjVZWeQn2S-D8FsU-0Ah7lCiAJH4,92095
30
30
  knowledge/services/group.py,sha256=b8dBBrHXqgwpJ7BtUqqweoR_WQH5MZ0aLh0fBBTyHUI,30698
31
31
  knowledge/services/helper.py,sha256=NYhRkYXtiFgovsXaQr6rBVN2mjBwOT7cSSuLTyjvzKA,4990
32
32
  knowledge/services/ontology.py,sha256=1QewHZoNTNrQe9cAgLMvWRPQ2YYn4IltscEOV9Dy2qM,51800
33
- knowledge/services/search.py,sha256=9I4ZdCFnVSCCmYHeQralrw47VwKnMqA08UpAq_BMxQs,19305
33
+ knowledge/services/search.py,sha256=L97EXWoG7XoYSLP5ABnN5BtOSd7yr9KLR6bZT4vzicc,19862
34
34
  knowledge/services/session.py,sha256=y8uTETRMDOBbC30UAlrrtWTN7Zgs2klqHsoMjLO2tq0,14145
35
35
  knowledge/services/tenant.py,sha256=rQsUe8qNFTt_WZG4XBTg8QSLoyavuCWLWk3QhU1fBG8,11728
36
36
  knowledge/services/users.py,sha256=nOwyZhqERTNFPTN21c_q7-6XaEMb3SnHfnXr4Kf22qk,16594
@@ -40,7 +40,7 @@ knowledge/utils/graph.py,sha256=kuPZEGhexVN9McoT8JK2ViIrfXTh-nFPv_8XPfG0wlA,1231
40
40
  knowledge/utils/import_format.py,sha256=fjuWpd91eAs7MbqSpLrFgdRvFaHK0nzV1L83ByjTmV0,5277
41
41
  knowledge/utils/wikidata.py,sha256=vRH-4AMR-3xywyvmDqbjI4KSw4tF4TEYqUGCJmUMqK8,5512
42
42
  knowledge/utils/wikipedia.py,sha256=rBuFqYVM58JCj5ISLxuhYVVl2gOIlPLWx7_CghyQgvE,5052
43
- personal_knowledge_library-3.3.0.dist-info/METADATA,sha256=xzv1A74fPWL7oB1DVg9tSVqnDyZ8fBxkmsVp_mzt4Vk,57120
44
- personal_knowledge_library-3.3.0.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
45
- personal_knowledge_library-3.3.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
46
- personal_knowledge_library-3.3.0.dist-info/RECORD,,
43
+ personal_knowledge_library-3.3.2.dist-info/METADATA,sha256=Cw39qFfSsOaRAyoTJgzlj_MG0aXcLwe1eIKVyr0uKFc,57120
44
+ personal_knowledge_library-3.3.2.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
45
+ personal_knowledge_library-3.3.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
46
+ personal_knowledge_library-3.3.2.dist-info/RECORD,,