pygeai 0.6.0b6__py3-none-any.whl → 0.6.0b7__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.
- pygeai/_docs/source/content/api_reference/admin.rst +161 -0
- pygeai/_docs/source/content/api_reference/assistant.rst +326 -0
- pygeai/_docs/source/content/api_reference/auth.rst +379 -0
- pygeai/_docs/source/content/api_reference/health.rst +58 -0
- pygeai/_docs/source/content/api_reference/project.rst +20 -18
- pygeai/_docs/source/content/api_reference/rerank.rst +94 -0
- pygeai/_docs/source/content/api_reference.rst +6 -1
- pygeai/_docs/source/index.rst +59 -7
- pygeai/_docs/source/pygeai.auth.rst +29 -0
- pygeai/_docs/source/pygeai.cli.commands.rst +16 -0
- pygeai/_docs/source/pygeai.core.utils.rst +16 -0
- pygeai/_docs/source/pygeai.rst +1 -0
- pygeai/_docs/source/pygeai.tests.auth.rst +21 -0
- pygeai/_docs/source/pygeai.tests.cli.commands.rst +16 -0
- pygeai/_docs/source/pygeai.tests.core.base.rst +8 -0
- pygeai/_docs/source/pygeai.tests.core.files.rst +8 -0
- pygeai/_docs/source/pygeai.tests.core.plugins.rst +21 -0
- pygeai/_docs/source/pygeai.tests.core.rst +1 -0
- pygeai/_docs/source/pygeai.tests.evaluation.dataset.rst +21 -0
- pygeai/_docs/source/pygeai.tests.evaluation.plan.rst +21 -0
- pygeai/_docs/source/pygeai.tests.evaluation.result.rst +21 -0
- pygeai/_docs/source/pygeai.tests.evaluation.rst +20 -0
- pygeai/_docs/source/pygeai.tests.integration.lab.processes.rst +8 -0
- pygeai/_docs/source/pygeai.tests.organization.rst +8 -0
- pygeai/_docs/source/pygeai.tests.rst +2 -0
- pygeai/_docs/source/pygeai.tests.snippets.auth.rst +10 -0
- pygeai/_docs/source/pygeai.tests.snippets.organization.rst +40 -0
- pygeai/_docs/source/pygeai.tests.snippets.rst +1 -0
- pygeai/admin/clients.py +7 -32
- pygeai/assistant/clients.py +9 -44
- pygeai/assistant/data/clients.py +1 -0
- pygeai/assistant/data_analyst/clients.py +4 -13
- pygeai/assistant/rag/clients.py +13 -67
- pygeai/auth/clients.py +88 -14
- pygeai/auth/endpoints.py +4 -0
- pygeai/chat/clients.py +1 -0
- pygeai/cli/commands/auth.py +178 -2
- pygeai/cli/commands/lab/ai_lab.py +0 -2
- pygeai/cli/commands/organization.py +241 -0
- pygeai/core/base/clients.py +1 -0
- pygeai/core/embeddings/clients.py +3 -7
- pygeai/core/feedback/clients.py +3 -8
- pygeai/core/files/clients.py +5 -18
- pygeai/core/llm/clients.py +7 -26
- pygeai/core/models.py +107 -0
- pygeai/core/plugins/clients.py +3 -7
- pygeai/core/rerank/clients.py +3 -8
- pygeai/core/secrets/clients.py +8 -37
- pygeai/core/utils/parsers.py +32 -0
- pygeai/core/utils/validators.py +10 -0
- pygeai/evaluation/clients.py +1 -0
- pygeai/evaluation/dataset/clients.py +1 -0
- pygeai/evaluation/plan/clients.py +1 -0
- pygeai/evaluation/result/clients.py +1 -0
- pygeai/gam/clients.py +6 -25
- pygeai/health/clients.py +3 -7
- pygeai/lab/agents/clients.py +13 -53
- pygeai/lab/agents/endpoints.py +2 -0
- pygeai/lab/clients.py +1 -0
- pygeai/lab/processes/clients.py +24 -127
- pygeai/lab/strategies/clients.py +7 -25
- pygeai/lab/tools/clients.py +22 -67
- pygeai/lab/tools/endpoints.py +3 -0
- pygeai/organization/clients.py +122 -51
- pygeai/organization/endpoints.py +6 -1
- pygeai/organization/limits/clients.py +17 -91
- pygeai/organization/managers.py +157 -1
- pygeai/organization/mappers.py +76 -2
- pygeai/organization/responses.py +25 -1
- pygeai/proxy/clients.py +1 -0
- pygeai/tests/auth/test_clients.py +183 -7
- pygeai/tests/organization/test_clients.py +184 -1
- pygeai/tests/organization/test_managers.py +122 -1
- pygeai/tests/snippets/auth/__init__.py +0 -0
- pygeai/tests/snippets/organization/get_memberships.py +12 -0
- pygeai/tests/snippets/organization/get_organization_members.py +6 -0
- pygeai/tests/snippets/organization/get_project_members.py +6 -0
- pygeai/tests/snippets/organization/get_project_memberships.py +12 -0
- pygeai/tests/snippets/organization/get_project_roles.py +6 -0
- {pygeai-0.6.0b6.dist-info → pygeai-0.6.0b7.dist-info}/METADATA +1 -1
- {pygeai-0.6.0b6.dist-info → pygeai-0.6.0b7.dist-info}/RECORD +85 -64
- {pygeai-0.6.0b6.dist-info → pygeai-0.6.0b7.dist-info}/WHEEL +0 -0
- {pygeai-0.6.0b6.dist-info → pygeai-0.6.0b7.dist-info}/entry_points.txt +0 -0
- {pygeai-0.6.0b6.dist-info → pygeai-0.6.0b7.dist-info}/licenses/LICENSE +0 -0
- {pygeai-0.6.0b6.dist-info → pygeai-0.6.0b7.dist-info}/top_level.txt +0 -0
pygeai/_docs/source/index.rst
CHANGED
|
@@ -1,21 +1,73 @@
|
|
|
1
|
-
PyGEAI
|
|
1
|
+
PyGEAI Documentation
|
|
2
2
|
====================
|
|
3
3
|
|
|
4
|
-
PyGEAI is a Python SDK developed to interact with the different components that constitute GEAI.
|
|
5
|
-
It
|
|
6
|
-
|
|
7
|
-
The
|
|
4
|
+
PyGEAI is a Python SDK developed to interact with the different components that constitute GEAI (Globant Enterprise AI).
|
|
5
|
+
It's composed of several resources that allow developers to work with GEAI's modules in an easy and simple manner.
|
|
6
|
+
|
|
7
|
+
The SDK provides libraries, tools, documentation, and code samples to deliver an easier development experience
|
|
8
|
+
with GEAI, without overhead of setup and configuration.
|
|
9
|
+
|
|
10
|
+
Getting Started
|
|
11
|
+
---------------
|
|
8
12
|
|
|
9
13
|
.. toctree::
|
|
10
14
|
:maxdepth: 2
|
|
11
|
-
:caption: Contents:
|
|
12
15
|
|
|
13
16
|
content/intro
|
|
14
17
|
content/quickstart
|
|
18
|
+
|
|
19
|
+
Core Features & API Reference
|
|
20
|
+
-------------------------------
|
|
21
|
+
|
|
22
|
+
Complete reference for all PyGEAI modules and APIs.
|
|
23
|
+
|
|
24
|
+
.. toctree::
|
|
25
|
+
:maxdepth: 2
|
|
26
|
+
|
|
15
27
|
content/api_reference
|
|
28
|
+
|
|
29
|
+
The API Reference includes:
|
|
30
|
+
|
|
31
|
+
* **Authentication** - OAuth2, API tokens, user profiles
|
|
32
|
+
* **Administration** - Token validation, organization access
|
|
33
|
+
* **Assistants** - Create and manage AI assistants
|
|
34
|
+
* **Chat** - Chat completions and streaming
|
|
35
|
+
* **Embeddings** - Text embeddings for similarity search
|
|
36
|
+
* **RAG** - Retrieval-Augmented Generation assistants
|
|
37
|
+
* **Reranking** - Document reranking for relevance
|
|
38
|
+
* **Projects** - Project and organization management
|
|
39
|
+
* **Health** - Service status and monitoring
|
|
40
|
+
|
|
41
|
+
Advanced Features
|
|
42
|
+
-----------------
|
|
43
|
+
|
|
44
|
+
.. toctree::
|
|
45
|
+
:maxdepth: 2
|
|
46
|
+
|
|
16
47
|
content/ai_lab
|
|
17
|
-
|
|
48
|
+
|
|
49
|
+
Tools & Utilities
|
|
50
|
+
-----------------
|
|
51
|
+
|
|
52
|
+
.. toctree::
|
|
53
|
+
:maxdepth: 2
|
|
54
|
+
|
|
18
55
|
content/cli
|
|
19
56
|
content/chat_gui
|
|
20
57
|
content/debugger
|
|
58
|
+
|
|
59
|
+
Additional Resources
|
|
60
|
+
--------------------
|
|
61
|
+
|
|
62
|
+
.. toctree::
|
|
63
|
+
:maxdepth: 2
|
|
64
|
+
|
|
65
|
+
content/samples
|
|
21
66
|
modules
|
|
67
|
+
|
|
68
|
+
Indices and tables
|
|
69
|
+
==================
|
|
70
|
+
|
|
71
|
+
* :ref:`genindex`
|
|
72
|
+
* :ref:`modindex`
|
|
73
|
+
* :ref:`search`
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
pygeai.auth package
|
|
2
|
+
===================
|
|
3
|
+
|
|
4
|
+
Submodules
|
|
5
|
+
----------
|
|
6
|
+
|
|
7
|
+
pygeai.auth.clients module
|
|
8
|
+
--------------------------
|
|
9
|
+
|
|
10
|
+
.. automodule:: pygeai.auth.clients
|
|
11
|
+
:members:
|
|
12
|
+
:show-inheritance:
|
|
13
|
+
:undoc-members:
|
|
14
|
+
|
|
15
|
+
pygeai.auth.endpoints module
|
|
16
|
+
----------------------------
|
|
17
|
+
|
|
18
|
+
.. automodule:: pygeai.auth.endpoints
|
|
19
|
+
:members:
|
|
20
|
+
:show-inheritance:
|
|
21
|
+
:undoc-members:
|
|
22
|
+
|
|
23
|
+
Module contents
|
|
24
|
+
---------------
|
|
25
|
+
|
|
26
|
+
.. automodule:: pygeai.auth
|
|
27
|
+
:members:
|
|
28
|
+
:show-inheritance:
|
|
29
|
+
:undoc-members:
|
|
@@ -29,6 +29,14 @@ pygeai.cli.commands.assistant module
|
|
|
29
29
|
:show-inheritance:
|
|
30
30
|
:undoc-members:
|
|
31
31
|
|
|
32
|
+
pygeai.cli.commands.auth module
|
|
33
|
+
-------------------------------
|
|
34
|
+
|
|
35
|
+
.. automodule:: pygeai.cli.commands.auth
|
|
36
|
+
:members:
|
|
37
|
+
:show-inheritance:
|
|
38
|
+
:undoc-members:
|
|
39
|
+
|
|
32
40
|
pygeai.cli.commands.base module
|
|
33
41
|
-------------------------------
|
|
34
42
|
|
|
@@ -69,6 +77,14 @@ pygeai.cli.commands.configuration module
|
|
|
69
77
|
:show-inheritance:
|
|
70
78
|
:undoc-members:
|
|
71
79
|
|
|
80
|
+
pygeai.cli.commands.docs module
|
|
81
|
+
-------------------------------
|
|
82
|
+
|
|
83
|
+
.. automodule:: pygeai.cli.commands.docs
|
|
84
|
+
:members:
|
|
85
|
+
:show-inheritance:
|
|
86
|
+
:undoc-members:
|
|
87
|
+
|
|
72
88
|
pygeai.cli.commands.embeddings module
|
|
73
89
|
-------------------------------------
|
|
74
90
|
|
|
@@ -12,6 +12,22 @@ pygeai.core.utils.console module
|
|
|
12
12
|
:show-inheritance:
|
|
13
13
|
:undoc-members:
|
|
14
14
|
|
|
15
|
+
pygeai.core.utils.parsers module
|
|
16
|
+
--------------------------------
|
|
17
|
+
|
|
18
|
+
.. automodule:: pygeai.core.utils.parsers
|
|
19
|
+
:members:
|
|
20
|
+
:show-inheritance:
|
|
21
|
+
:undoc-members:
|
|
22
|
+
|
|
23
|
+
pygeai.core.utils.validators module
|
|
24
|
+
-----------------------------------
|
|
25
|
+
|
|
26
|
+
.. automodule:: pygeai.core.utils.validators
|
|
27
|
+
:members:
|
|
28
|
+
:show-inheritance:
|
|
29
|
+
:undoc-members:
|
|
30
|
+
|
|
15
31
|
Module contents
|
|
16
32
|
---------------
|
|
17
33
|
|
pygeai/_docs/source/pygeai.rst
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
pygeai.tests.auth package
|
|
2
|
+
=========================
|
|
3
|
+
|
|
4
|
+
Submodules
|
|
5
|
+
----------
|
|
6
|
+
|
|
7
|
+
pygeai.tests.auth.test\_clients module
|
|
8
|
+
--------------------------------------
|
|
9
|
+
|
|
10
|
+
.. automodule:: pygeai.tests.auth.test_clients
|
|
11
|
+
:members:
|
|
12
|
+
:show-inheritance:
|
|
13
|
+
:undoc-members:
|
|
14
|
+
|
|
15
|
+
Module contents
|
|
16
|
+
---------------
|
|
17
|
+
|
|
18
|
+
.. automodule:: pygeai.tests.auth
|
|
19
|
+
:members:
|
|
20
|
+
:show-inheritance:
|
|
21
|
+
:undoc-members:
|
|
@@ -44,6 +44,14 @@ pygeai.tests.cli.commands.test\_embeddings module
|
|
|
44
44
|
:show-inheritance:
|
|
45
45
|
:undoc-members:
|
|
46
46
|
|
|
47
|
+
pygeai.tests.cli.commands.test\_evaluation module
|
|
48
|
+
-------------------------------------------------
|
|
49
|
+
|
|
50
|
+
.. automodule:: pygeai.tests.cli.commands.test_evaluation
|
|
51
|
+
:members:
|
|
52
|
+
:show-inheritance:
|
|
53
|
+
:undoc-members:
|
|
54
|
+
|
|
47
55
|
pygeai.tests.cli.commands.test\_feedback module
|
|
48
56
|
-----------------------------------------------
|
|
49
57
|
|
|
@@ -108,6 +116,14 @@ pygeai.tests.cli.commands.test\_rerank module
|
|
|
108
116
|
:show-inheritance:
|
|
109
117
|
:undoc-members:
|
|
110
118
|
|
|
119
|
+
pygeai.tests.cli.commands.test\_secrets module
|
|
120
|
+
----------------------------------------------
|
|
121
|
+
|
|
122
|
+
.. automodule:: pygeai.tests.cli.commands.test_secrets
|
|
123
|
+
:members:
|
|
124
|
+
:show-inheritance:
|
|
125
|
+
:undoc-members:
|
|
126
|
+
|
|
111
127
|
pygeai.tests.cli.commands.test\_show\_help module
|
|
112
128
|
-------------------------------------------------
|
|
113
129
|
|
|
@@ -28,6 +28,14 @@ pygeai.tests.core.base.test\_models module
|
|
|
28
28
|
:show-inheritance:
|
|
29
29
|
:undoc-members:
|
|
30
30
|
|
|
31
|
+
pygeai.tests.core.base.test\_responses module
|
|
32
|
+
---------------------------------------------
|
|
33
|
+
|
|
34
|
+
.. automodule:: pygeai.tests.core.base.test_responses
|
|
35
|
+
:members:
|
|
36
|
+
:show-inheritance:
|
|
37
|
+
:undoc-members:
|
|
38
|
+
|
|
31
39
|
Module contents
|
|
32
40
|
---------------
|
|
33
41
|
|
|
@@ -20,6 +20,14 @@ pygeai.tests.core.files.test\_managers module
|
|
|
20
20
|
:show-inheritance:
|
|
21
21
|
:undoc-members:
|
|
22
22
|
|
|
23
|
+
pygeai.tests.core.files.test\_mappers module
|
|
24
|
+
--------------------------------------------
|
|
25
|
+
|
|
26
|
+
.. automodule:: pygeai.tests.core.files.test_mappers
|
|
27
|
+
:members:
|
|
28
|
+
:show-inheritance:
|
|
29
|
+
:undoc-members:
|
|
30
|
+
|
|
23
31
|
pygeai.tests.core.files.test\_models module
|
|
24
32
|
-------------------------------------------
|
|
25
33
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
pygeai.tests.core.plugins package
|
|
2
|
+
=================================
|
|
3
|
+
|
|
4
|
+
Submodules
|
|
5
|
+
----------
|
|
6
|
+
|
|
7
|
+
pygeai.tests.core.plugins.test\_clients module
|
|
8
|
+
----------------------------------------------
|
|
9
|
+
|
|
10
|
+
.. automodule:: pygeai.tests.core.plugins.test_clients
|
|
11
|
+
:members:
|
|
12
|
+
:show-inheritance:
|
|
13
|
+
:undoc-members:
|
|
14
|
+
|
|
15
|
+
Module contents
|
|
16
|
+
---------------
|
|
17
|
+
|
|
18
|
+
.. automodule:: pygeai.tests.core.plugins
|
|
19
|
+
:members:
|
|
20
|
+
:show-inheritance:
|
|
21
|
+
:undoc-members:
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
pygeai.tests.evaluation.dataset package
|
|
2
|
+
=======================================
|
|
3
|
+
|
|
4
|
+
Submodules
|
|
5
|
+
----------
|
|
6
|
+
|
|
7
|
+
pygeai.tests.evaluation.dataset.test\_clients module
|
|
8
|
+
----------------------------------------------------
|
|
9
|
+
|
|
10
|
+
.. automodule:: pygeai.tests.evaluation.dataset.test_clients
|
|
11
|
+
:members:
|
|
12
|
+
:show-inheritance:
|
|
13
|
+
:undoc-members:
|
|
14
|
+
|
|
15
|
+
Module contents
|
|
16
|
+
---------------
|
|
17
|
+
|
|
18
|
+
.. automodule:: pygeai.tests.evaluation.dataset
|
|
19
|
+
:members:
|
|
20
|
+
:show-inheritance:
|
|
21
|
+
:undoc-members:
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
pygeai.tests.evaluation.plan package
|
|
2
|
+
====================================
|
|
3
|
+
|
|
4
|
+
Submodules
|
|
5
|
+
----------
|
|
6
|
+
|
|
7
|
+
pygeai.tests.evaluation.plan.test\_clients module
|
|
8
|
+
-------------------------------------------------
|
|
9
|
+
|
|
10
|
+
.. automodule:: pygeai.tests.evaluation.plan.test_clients
|
|
11
|
+
:members:
|
|
12
|
+
:show-inheritance:
|
|
13
|
+
:undoc-members:
|
|
14
|
+
|
|
15
|
+
Module contents
|
|
16
|
+
---------------
|
|
17
|
+
|
|
18
|
+
.. automodule:: pygeai.tests.evaluation.plan
|
|
19
|
+
:members:
|
|
20
|
+
:show-inheritance:
|
|
21
|
+
:undoc-members:
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
pygeai.tests.evaluation.result package
|
|
2
|
+
======================================
|
|
3
|
+
|
|
4
|
+
Submodules
|
|
5
|
+
----------
|
|
6
|
+
|
|
7
|
+
pygeai.tests.evaluation.result.test\_clients module
|
|
8
|
+
---------------------------------------------------
|
|
9
|
+
|
|
10
|
+
.. automodule:: pygeai.tests.evaluation.result.test_clients
|
|
11
|
+
:members:
|
|
12
|
+
:show-inheritance:
|
|
13
|
+
:undoc-members:
|
|
14
|
+
|
|
15
|
+
Module contents
|
|
16
|
+
---------------
|
|
17
|
+
|
|
18
|
+
.. automodule:: pygeai.tests.evaluation.result
|
|
19
|
+
:members:
|
|
20
|
+
:show-inheritance:
|
|
21
|
+
:undoc-members:
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
pygeai.tests.evaluation package
|
|
2
|
+
===============================
|
|
3
|
+
|
|
4
|
+
Subpackages
|
|
5
|
+
-----------
|
|
6
|
+
|
|
7
|
+
.. toctree::
|
|
8
|
+
:maxdepth: 4
|
|
9
|
+
|
|
10
|
+
pygeai.tests.evaluation.dataset
|
|
11
|
+
pygeai.tests.evaluation.plan
|
|
12
|
+
pygeai.tests.evaluation.result
|
|
13
|
+
|
|
14
|
+
Module contents
|
|
15
|
+
---------------
|
|
16
|
+
|
|
17
|
+
.. automodule:: pygeai.tests.evaluation
|
|
18
|
+
:members:
|
|
19
|
+
:show-inheritance:
|
|
20
|
+
:undoc-members:
|
|
@@ -12,6 +12,14 @@ pygeai.tests.integration.lab.processes.test\_create\_process module
|
|
|
12
12
|
:show-inheritance:
|
|
13
13
|
:undoc-members:
|
|
14
14
|
|
|
15
|
+
pygeai.tests.integration.lab.processes.test\_create\_task module
|
|
16
|
+
----------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
.. automodule:: pygeai.tests.integration.lab.processes.test_create_task
|
|
19
|
+
:members:
|
|
20
|
+
:show-inheritance:
|
|
21
|
+
:undoc-members:
|
|
22
|
+
|
|
15
23
|
pygeai.tests.integration.lab.processes.test\_delete\_process module
|
|
16
24
|
-------------------------------------------------------------------
|
|
17
25
|
|
|
@@ -36,6 +36,14 @@ pygeai.tests.organization.test\_mappers module
|
|
|
36
36
|
:show-inheritance:
|
|
37
37
|
:undoc-members:
|
|
38
38
|
|
|
39
|
+
pygeai.tests.organization.test\_responses module
|
|
40
|
+
------------------------------------------------
|
|
41
|
+
|
|
42
|
+
.. automodule:: pygeai.tests.organization.test_responses
|
|
43
|
+
:members:
|
|
44
|
+
:show-inheritance:
|
|
45
|
+
:undoc-members:
|
|
46
|
+
|
|
39
47
|
Module contents
|
|
40
48
|
---------------
|
|
41
49
|
|
|
@@ -9,10 +9,12 @@ Subpackages
|
|
|
9
9
|
|
|
10
10
|
pygeai.tests.admin
|
|
11
11
|
pygeai.tests.assistants
|
|
12
|
+
pygeai.tests.auth
|
|
12
13
|
pygeai.tests.chat
|
|
13
14
|
pygeai.tests.cli
|
|
14
15
|
pygeai.tests.core
|
|
15
16
|
pygeai.tests.dbg
|
|
17
|
+
pygeai.tests.evaluation
|
|
16
18
|
pygeai.tests.gam
|
|
17
19
|
pygeai.tests.health
|
|
18
20
|
pygeai.tests.integration
|
|
@@ -28,6 +28,22 @@ pygeai.tests.snippets.organization.export\_request\_data module
|
|
|
28
28
|
:show-inheritance:
|
|
29
29
|
:undoc-members:
|
|
30
30
|
|
|
31
|
+
pygeai.tests.snippets.organization.get\_memberships module
|
|
32
|
+
----------------------------------------------------------
|
|
33
|
+
|
|
34
|
+
.. automodule:: pygeai.tests.snippets.organization.get_memberships
|
|
35
|
+
:members:
|
|
36
|
+
:show-inheritance:
|
|
37
|
+
:undoc-members:
|
|
38
|
+
|
|
39
|
+
pygeai.tests.snippets.organization.get\_organization\_members module
|
|
40
|
+
--------------------------------------------------------------------
|
|
41
|
+
|
|
42
|
+
.. automodule:: pygeai.tests.snippets.organization.get_organization_members
|
|
43
|
+
:members:
|
|
44
|
+
:show-inheritance:
|
|
45
|
+
:undoc-members:
|
|
46
|
+
|
|
31
47
|
pygeai.tests.snippets.organization.get\_project\_data module
|
|
32
48
|
------------------------------------------------------------
|
|
33
49
|
|
|
@@ -44,6 +60,30 @@ pygeai.tests.snippets.organization.get\_project\_list module
|
|
|
44
60
|
:show-inheritance:
|
|
45
61
|
:undoc-members:
|
|
46
62
|
|
|
63
|
+
pygeai.tests.snippets.organization.get\_project\_members module
|
|
64
|
+
---------------------------------------------------------------
|
|
65
|
+
|
|
66
|
+
.. automodule:: pygeai.tests.snippets.organization.get_project_members
|
|
67
|
+
:members:
|
|
68
|
+
:show-inheritance:
|
|
69
|
+
:undoc-members:
|
|
70
|
+
|
|
71
|
+
pygeai.tests.snippets.organization.get\_project\_memberships module
|
|
72
|
+
-------------------------------------------------------------------
|
|
73
|
+
|
|
74
|
+
.. automodule:: pygeai.tests.snippets.organization.get_project_memberships
|
|
75
|
+
:members:
|
|
76
|
+
:show-inheritance:
|
|
77
|
+
:undoc-members:
|
|
78
|
+
|
|
79
|
+
pygeai.tests.snippets.organization.get\_project\_roles module
|
|
80
|
+
-------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
.. automodule:: pygeai.tests.snippets.organization.get_project_roles
|
|
83
|
+
:members:
|
|
84
|
+
:show-inheritance:
|
|
85
|
+
:undoc-members:
|
|
86
|
+
|
|
47
87
|
pygeai.tests.snippets.organization.get\_project\_tokens module
|
|
48
88
|
--------------------------------------------------------------
|
|
49
89
|
|
pygeai/admin/clients.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import json
|
|
2
|
-
from json import JSONDecodeError
|
|
3
1
|
|
|
4
2
|
from pygeai import logger
|
|
5
3
|
from pygeai.admin.endpoints import GET_API_TOKEN_VALIDATION_V1, GET_AUTHORIZED_ORGANIZATIONS_V1, \
|
|
6
4
|
GET_AUTHORIZED_PROJECTS_V1, GET_PROJECT_VISIBILITY_V1, GET_PROJECT_API_TOKEN_V1
|
|
7
5
|
from pygeai.core.base.clients import BaseClient
|
|
8
6
|
from pygeai.core.common.exceptions import InvalidAPIResponseException
|
|
7
|
+
from pygeai.core.utils.validators import validate_status_code
|
|
8
|
+
from pygeai.core.utils.parsers import parse_json_response
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class AdminClient(BaseClient):
|
|
@@ -17,12 +17,7 @@ class AdminClient(BaseClient):
|
|
|
17
17
|
:return: dict - The API response containing organization and project information in JSON format.
|
|
18
18
|
"""
|
|
19
19
|
response = self.api_service.get(endpoint=GET_API_TOKEN_VALIDATION_V1)
|
|
20
|
-
|
|
21
|
-
result = response.json()
|
|
22
|
-
return result
|
|
23
|
-
except JSONDecodeError as e:
|
|
24
|
-
logger.error(f"Unable to validate API token: JSON parsing error (status {response.status_code}): {e}. Response: {response.text}")
|
|
25
|
-
raise InvalidAPIResponseException(f"Unable to validate API token: {response.text}")
|
|
20
|
+
return parse_json_response(response, "validate API token")
|
|
26
21
|
|
|
27
22
|
def get_authorized_organizations(self) -> dict:
|
|
28
23
|
"""
|
|
@@ -31,12 +26,7 @@ class AdminClient(BaseClient):
|
|
|
31
26
|
:return: dict - The API response containing the list of authorized organizations in JSON format.
|
|
32
27
|
"""
|
|
33
28
|
response = self.api_service.get(endpoint=GET_AUTHORIZED_ORGANIZATIONS_V1)
|
|
34
|
-
|
|
35
|
-
result = response.json()
|
|
36
|
-
return result
|
|
37
|
-
except JSONDecodeError as e:
|
|
38
|
-
logger.error(f"Unable to retrieve authorized organizations: JSON parsing error (status {response.status_code}): {e}. Response: {response.text}")
|
|
39
|
-
raise InvalidAPIResponseException(f"Unable to retrieve authorized organizations: {response.text}")
|
|
29
|
+
return parse_json_response(response, "retrieve authorized organizations")
|
|
40
30
|
|
|
41
31
|
def get_authorized_projects_by_organization(
|
|
42
32
|
self,
|
|
@@ -54,12 +44,7 @@ class AdminClient(BaseClient):
|
|
|
54
44
|
"organization": organization
|
|
55
45
|
}
|
|
56
46
|
)
|
|
57
|
-
|
|
58
|
-
result = response.json()
|
|
59
|
-
return result
|
|
60
|
-
except JSONDecodeError as e:
|
|
61
|
-
logger.error(f"Unable to retrieve authorized projects for organization '{organization}': JSON parsing error (status {response.status_code}): {e}. Response: {response.text}")
|
|
62
|
-
raise InvalidAPIResponseException(f"Unable to retrieve authorized projects for organization {organization}: {response.text}")
|
|
47
|
+
return parse_json_response(response, "retrieve authorized projects for organization", organization=organization)
|
|
63
48
|
|
|
64
49
|
def get_project_visibility(
|
|
65
50
|
self,
|
|
@@ -90,12 +75,7 @@ class AdminClient(BaseClient):
|
|
|
90
75
|
"accessToken": access_token
|
|
91
76
|
}
|
|
92
77
|
)
|
|
93
|
-
|
|
94
|
-
result = response.json()
|
|
95
|
-
return result
|
|
96
|
-
except JSONDecodeError as e:
|
|
97
|
-
logger.error(f"Unable to retrieve project visibility for organization '{organization}' and project '{project}': JSON parsing error (status {response.status_code}): {e}. Response: {response.text}")
|
|
98
|
-
raise InvalidAPIResponseException(f"Unable to retrieve project visibility for organization {organization} and project {project}: {response.text}")
|
|
78
|
+
return parse_json_response(response, "retrieve project visibility", organization=organization, project=project)
|
|
99
79
|
|
|
100
80
|
def get_project_api_token(
|
|
101
81
|
self,
|
|
@@ -127,9 +107,4 @@ class AdminClient(BaseClient):
|
|
|
127
107
|
"accessToken": access_token
|
|
128
108
|
}
|
|
129
109
|
)
|
|
130
|
-
|
|
131
|
-
result = response.json()
|
|
132
|
-
return result
|
|
133
|
-
except JSONDecodeError as e:
|
|
134
|
-
logger.error(f"Unable to retrieve project API token for organization '{organization}' and project '{project}': JSON parsing error (status {response.status_code}): {e}. Response: {response.text}")
|
|
135
|
-
raise InvalidAPIResponseException(f"Unable to retrieve project API token for organization {organization} and project {project}: {response.text}")
|
|
110
|
+
return parse_json_response(response, "retrieve project API token", organization=organization, project=project)
|