pygeai 0.6.0b3__py3-none-any.whl → 0.6.0b6__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 (145) hide show
  1. pygeai/_docs/Makefile +20 -0
  2. pygeai/_docs/make.bat +35 -0
  3. pygeai/_docs/source/conf.py +45 -0
  4. pygeai/_docs/source/content/ai_lab/cli.rst +747 -0
  5. pygeai/_docs/source/content/ai_lab/models.rst +1600 -0
  6. pygeai/_docs/source/content/ai_lab/runner.rst +253 -0
  7. pygeai/_docs/source/content/ai_lab/spec.rst +431 -0
  8. pygeai/_docs/source/content/ai_lab/usage.rst +1011 -0
  9. pygeai/_docs/source/content/ai_lab.rst +102 -0
  10. pygeai/_docs/source/content/api_reference/chat.rst +328 -0
  11. pygeai/_docs/source/content/api_reference/embeddings.rst +124 -0
  12. pygeai/_docs/source/content/api_reference/project.rst +552 -0
  13. pygeai/_docs/source/content/api_reference/rag.rst +710 -0
  14. pygeai/_docs/source/content/api_reference.rst +46 -0
  15. pygeai/_docs/source/content/chat_gui.rst +121 -0
  16. pygeai/_docs/source/content/cli.rst +126 -0
  17. pygeai/_docs/source/content/debugger.rst +188 -0
  18. pygeai/_docs/source/content/intro.rst +67 -0
  19. pygeai/_docs/source/content/modules.rst +7 -0
  20. pygeai/_docs/source/content/quickstart.rst +143 -0
  21. pygeai/_docs/source/content/samples.rst +394 -0
  22. pygeai/_docs/source/index.rst +21 -0
  23. pygeai/_docs/source/modules.rst +7 -0
  24. pygeai/_docs/source/pygeai.admin.rst +29 -0
  25. pygeai/_docs/source/pygeai.assistant.data.rst +21 -0
  26. pygeai/_docs/source/pygeai.assistant.data_analyst.rst +29 -0
  27. pygeai/_docs/source/pygeai.assistant.rag.rst +53 -0
  28. pygeai/_docs/source/pygeai.assistant.rst +55 -0
  29. pygeai/_docs/source/pygeai.chat.rst +69 -0
  30. pygeai/_docs/source/pygeai.cli.commands.flows.rst +10 -0
  31. pygeai/_docs/source/pygeai.cli.commands.lab.rst +53 -0
  32. pygeai/_docs/source/pygeai.cli.commands.rst +198 -0
  33. pygeai/_docs/source/pygeai.cli.rst +54 -0
  34. pygeai/_docs/source/pygeai.cli.texts.rst +21 -0
  35. pygeai/_docs/source/pygeai.core.base.rst +53 -0
  36. pygeai/_docs/source/pygeai.core.common.rst +37 -0
  37. pygeai/_docs/source/pygeai.core.embeddings.rst +61 -0
  38. pygeai/_docs/source/pygeai.core.feedback.rst +37 -0
  39. pygeai/_docs/source/pygeai.core.files.rst +61 -0
  40. pygeai/_docs/source/pygeai.core.llm.rst +29 -0
  41. pygeai/_docs/source/pygeai.core.plugins.rst +37 -0
  42. pygeai/_docs/source/pygeai.core.rerank.rst +53 -0
  43. pygeai/_docs/source/pygeai.core.rst +63 -0
  44. pygeai/_docs/source/pygeai.core.secrets.rst +29 -0
  45. pygeai/_docs/source/pygeai.core.services.llm.rst +29 -0
  46. pygeai/_docs/source/pygeai.core.services.rst +37 -0
  47. pygeai/_docs/source/pygeai.core.utils.rst +21 -0
  48. pygeai/_docs/source/pygeai.dbg.rst +21 -0
  49. pygeai/_docs/source/pygeai.evaluation.dataset.rst +29 -0
  50. pygeai/_docs/source/pygeai.evaluation.plan.rst +29 -0
  51. pygeai/_docs/source/pygeai.evaluation.result.rst +29 -0
  52. pygeai/_docs/source/pygeai.evaluation.rst +31 -0
  53. pygeai/_docs/source/pygeai.flows.rst +29 -0
  54. pygeai/_docs/source/pygeai.gam.rst +29 -0
  55. pygeai/_docs/source/pygeai.health.rst +29 -0
  56. pygeai/_docs/source/pygeai.lab.agents.rst +37 -0
  57. pygeai/_docs/source/pygeai.lab.processes.rst +37 -0
  58. pygeai/_docs/source/pygeai.lab.rst +65 -0
  59. pygeai/_docs/source/pygeai.lab.spec.rst +29 -0
  60. pygeai/_docs/source/pygeai.lab.strategies.rst +37 -0
  61. pygeai/_docs/source/pygeai.lab.tools.rst +37 -0
  62. pygeai/_docs/source/pygeai.man.man1.rst +10 -0
  63. pygeai/_docs/source/pygeai.man.rst +18 -0
  64. pygeai/_docs/source/pygeai.migration.rst +29 -0
  65. pygeai/_docs/source/pygeai.organization.limits.rst +45 -0
  66. pygeai/_docs/source/pygeai.organization.rst +61 -0
  67. pygeai/_docs/source/pygeai.proxy.rst +53 -0
  68. pygeai/_docs/source/pygeai.rst +33 -0
  69. pygeai/_docs/source/pygeai.tests.admin.rst +21 -0
  70. pygeai/_docs/source/pygeai.tests.assistants.rag.rst +37 -0
  71. pygeai/_docs/source/pygeai.tests.assistants.rst +45 -0
  72. pygeai/_docs/source/pygeai.tests.chat.rst +45 -0
  73. pygeai/_docs/source/pygeai.tests.cli.commands.lab.rst +37 -0
  74. pygeai/_docs/source/pygeai.tests.cli.commands.rst +149 -0
  75. pygeai/_docs/source/pygeai.tests.cli.docker.rst +10 -0
  76. pygeai/_docs/source/pygeai.tests.cli.rst +30 -0
  77. pygeai/_docs/source/pygeai.tests.core.base.data.rst +29 -0
  78. pygeai/_docs/source/pygeai.tests.core.base.rst +37 -0
  79. pygeai/_docs/source/pygeai.tests.core.common.data.rst +10 -0
  80. pygeai/_docs/source/pygeai.tests.core.common.rst +37 -0
  81. pygeai/_docs/source/pygeai.tests.core.embeddings.rst +21 -0
  82. pygeai/_docs/source/pygeai.tests.core.feedback.rst +21 -0
  83. pygeai/_docs/source/pygeai.tests.core.files.rst +45 -0
  84. pygeai/_docs/source/pygeai.tests.core.llm.rst +21 -0
  85. pygeai/_docs/source/pygeai.tests.core.rerank.rst +37 -0
  86. pygeai/_docs/source/pygeai.tests.core.rst +38 -0
  87. pygeai/_docs/source/pygeai.tests.core.secrets.rst +21 -0
  88. pygeai/_docs/source/pygeai.tests.core.services.rst +21 -0
  89. pygeai/_docs/source/pygeai.tests.core.utils.rst +21 -0
  90. pygeai/_docs/source/pygeai.tests.dbg.rst +21 -0
  91. pygeai/_docs/source/pygeai.tests.gam.rst +21 -0
  92. pygeai/_docs/source/pygeai.tests.health.rst +21 -0
  93. pygeai/_docs/source/pygeai.tests.integration.assistants.rag.rst +21 -0
  94. pygeai/_docs/source/pygeai.tests.integration.assistants.rst +18 -0
  95. pygeai/_docs/source/pygeai.tests.integration.chat.rst +21 -0
  96. pygeai/_docs/source/pygeai.tests.integration.lab.agents.rst +69 -0
  97. pygeai/_docs/source/pygeai.tests.integration.lab.processes.rst +69 -0
  98. pygeai/_docs/source/pygeai.tests.integration.lab.reasoning_strategies.rst +37 -0
  99. pygeai/_docs/source/pygeai.tests.integration.lab.rst +21 -0
  100. pygeai/_docs/source/pygeai.tests.integration.lab.tools.rst +77 -0
  101. pygeai/_docs/source/pygeai.tests.integration.rst +20 -0
  102. pygeai/_docs/source/pygeai.tests.lab.agents.rst +29 -0
  103. pygeai/_docs/source/pygeai.tests.lab.processes.rst +29 -0
  104. pygeai/_docs/source/pygeai.tests.lab.rst +49 -0
  105. pygeai/_docs/source/pygeai.tests.lab.spec.rst +29 -0
  106. pygeai/_docs/source/pygeai.tests.lab.strategies.rst +29 -0
  107. pygeai/_docs/source/pygeai.tests.lab.tools.rst +29 -0
  108. pygeai/_docs/source/pygeai.tests.migration.rst +29 -0
  109. pygeai/_docs/source/pygeai.tests.organization.limits.rst +29 -0
  110. pygeai/_docs/source/pygeai.tests.organization.rst +45 -0
  111. pygeai/_docs/source/pygeai.tests.proxy.rst +61 -0
  112. pygeai/_docs/source/pygeai.tests.rst +31 -0
  113. pygeai/_docs/source/pygeai.tests.snippets.assistants.data_analyst.rst +37 -0
  114. pygeai/_docs/source/pygeai.tests.snippets.assistants.rag.rst +85 -0
  115. pygeai/_docs/source/pygeai.tests.snippets.assistants.rst +78 -0
  116. pygeai/_docs/source/pygeai.tests.snippets.chat.rst +85 -0
  117. pygeai/_docs/source/pygeai.tests.snippets.embeddings.rst +21 -0
  118. pygeai/_docs/source/pygeai.tests.snippets.evaluation.rst +10 -0
  119. pygeai/_docs/source/pygeai.tests.snippets.extras.rst +37 -0
  120. pygeai/_docs/source/pygeai.tests.snippets.files.rst +53 -0
  121. pygeai/_docs/source/pygeai.tests.snippets.gam.rst +21 -0
  122. pygeai/_docs/source/pygeai.tests.snippets.lab.agents.rst +93 -0
  123. pygeai/_docs/source/pygeai.tests.snippets.lab.processes.jobs.rst +21 -0
  124. pygeai/_docs/source/pygeai.tests.snippets.lab.processes.kbs.rst +45 -0
  125. pygeai/_docs/source/pygeai.tests.snippets.lab.processes.rst +46 -0
  126. pygeai/_docs/source/pygeai.tests.snippets.lab.rst +82 -0
  127. pygeai/_docs/source/pygeai.tests.snippets.lab.samples.rst +21 -0
  128. pygeai/_docs/source/pygeai.tests.snippets.lab.strategies.rst +45 -0
  129. pygeai/_docs/source/pygeai.tests.snippets.lab.tools.rst +85 -0
  130. pygeai/_docs/source/pygeai.tests.snippets.lab.use_cases.rst +117 -0
  131. pygeai/_docs/source/pygeai.tests.snippets.migrate.rst +10 -0
  132. pygeai/_docs/source/pygeai.tests.snippets.organization.rst +69 -0
  133. pygeai/_docs/source/pygeai.tests.snippets.rag.rst +85 -0
  134. pygeai/_docs/source/pygeai.tests.snippets.rerank.rst +21 -0
  135. pygeai/_docs/source/pygeai.tests.snippets.rst +30 -0
  136. pygeai/_docs/source/pygeai.tests.snippets.secrets.rst +10 -0
  137. pygeai/_docs/source/pygeai.tests.snippets.usage_limit.rst +77 -0
  138. pygeai/cli/commands/base.py +9 -9
  139. pygeai/cli/commands/docs.py +2 -2
  140. {pygeai-0.6.0b3.dist-info → pygeai-0.6.0b6.dist-info}/METADATA +1 -1
  141. {pygeai-0.6.0b3.dist-info → pygeai-0.6.0b6.dist-info}/RECORD +145 -8
  142. {pygeai-0.6.0b3.dist-info → pygeai-0.6.0b6.dist-info}/WHEEL +0 -0
  143. {pygeai-0.6.0b3.dist-info → pygeai-0.6.0b6.dist-info}/entry_points.txt +0 -0
  144. {pygeai-0.6.0b3.dist-info → pygeai-0.6.0b6.dist-info}/licenses/LICENSE +0 -0
  145. {pygeai-0.6.0b3.dist-info → pygeai-0.6.0b6.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,46 @@
1
+ API Reference
2
+ =============
3
+
4
+ This document provides a comprehensive overview of **API Reference**, outlining its structure and available functionalities.
5
+
6
+ .. toctree::
7
+ :maxdepth: 2
8
+ :caption: Contents:
9
+
10
+ api_reference/chat
11
+ api_reference/project
12
+ api_reference/rag
13
+ api_reference/embeddings
14
+
15
+
16
+ Authentication
17
+ --------------
18
+ To use the API, you need to authenticate each request using `API Tokens <https://wiki.genexus.com/enterprise-ai/wiki?564,API+Tokens>`_. These tokens are managed in `Globant Enterprise AI Backoffice <https://wiki.genexus.com/enterprise-ai/wiki?42,Globant+Enterprise+AI+Backoffice>`_.
19
+
20
+ The following properties are common to every interaction with **API Reference**:
21
+
22
+ ========================== ================================================================
23
+ Variable Description
24
+ ========================== ================================================================
25
+ `GEAI_API_BASE_URL` `$BASE_URL`. The base URL for your Globant Enterprise AI installation (e.g., https://api.saia.ai or a custom value).
26
+ `GEAI_API_KEY` `$SAIA_APITOKEN`. An API token generated for each project or organization.
27
+ ========================== ================================================================
28
+
29
+ Interaction Levels
30
+ ------------------
31
+ The API is designed with three levels of abstraction to cater to different use cases and developer preferences:
32
+
33
+ Command Line
34
+ ~~~~~~~~~~~~
35
+ This level provides a straightforward way to interact with the `Globant Enterprise AI <https://wiki.genexus.com/enterprise-ai/wiki?8,Table+of+contents%3AEnterprise+AI>`_ using simple commands. It handles the communication with the REST API and presents the responses in an easy-to-understand format.
36
+
37
+ Low-Level Service Layer
38
+ ~~~~~~~~~~~~~~~~~~~~~~~
39
+ This layer offers more granular control over API interactions. You work directly with client classes that handle the HTTP requests and responses. This layer returns data in JSON format, providing flexibility for further processing.
40
+
41
+ High-Level Service Layer
42
+ ~~~~~~~~~~~~~~~~~~~~~~~~
43
+ This layer abstracts away the complexities of handling raw JSON data. It uses manager classes that map the JSON responses to Python objects, simplifying data manipulation and integration with your application logic.
44
+
45
+ Each item in this section has these three ways of implementing a function. The user can choose the one that adequate
46
+ better to their use case.
@@ -0,0 +1,121 @@
1
+ GEAI Chat GUI Documentation
2
+ ===========================
3
+
4
+ Overview
5
+ --------
6
+
7
+ The GEAI Chat GUI is a Streamlit-based graphical user interface (GUI) for interacting with AI agents provided by the Globant Enterprise AI (GEAI) platform. This interface is launched via the `geai chat agent` command with the `--gui` or `-g` flag. It allows users to chat with specified agents, manage chat sessions, switch between agents, and customize session storage settings.
8
+
9
+ This documentation provides an overview of the GUI's features, usage instructions, and command-line invocation.
10
+
11
+ Command-Line Invocation
12
+ -----------------------
13
+
14
+ The Streamlit GUI is not run as a standalone Streamlit app but is invoked through the GEAI CLI. The relevant command and options are as follows:
15
+
16
+ .. code-block:: bash
17
+
18
+ geai chat agent --agent-name <agent_name> --gui
19
+
20
+ **Options:**
21
+
22
+ - ``--agent-name`` or ``-n``: Specifies the name or ID of the agent to interact with. This is a required argument.
23
+ - ``--gui`` or ``-g``: Launches the Streamlit GUI for an interactive chat experience. No additional argument is needed for this flag.
24
+
25
+ **Example:**
26
+
27
+ .. code-block:: bash
28
+
29
+ geai chat agent --agent-name "MyAgent" --gui
30
+
31
+ This command launches the Streamlit GUI for chatting with the agent named "MyAgent".
32
+
33
+ Features of the Streamlit GUI
34
+ -----------------------------
35
+
36
+ The GEAI Chat GUI provides a user-friendly interface for interacting with AI agents. Below are the key features, organized by their location in the interface (main area and sidebar).
37
+
38
+ Main Interface
39
+ ~~~~~~~~~~~~~~
40
+
41
+ 1. **Chat Window:**
42
+ - Displays the conversation history with the selected agent.
43
+ - Supports real-time message streaming for agent responses.
44
+ - Allows searching through chat history using a keyword filter.
45
+ - Provides options to edit the last user message and regenerate the agent's response if needed.
46
+ - Includes a "Complete Answer" button to prompt the agent to continue an incomplete response.
47
+
48
+ 2. **Chat Input:**
49
+ - Located at the bottom of the main window, allowing users to type and send messages to the agent.
50
+
51
+ 3. **Session Information:**
52
+ - Displays the path where the current session will be saved (e.g., ``chats/chat_session_<agent_name>_<date>.json``).
53
+
54
+ 4. **Reset Chat:**
55
+ - A button to clear the current chat history and start a fresh session with the agent's introductory message.
56
+
57
+ Sidebar Features
58
+ ~~~~~~~~~~~~~~~~
59
+
60
+ The sidebar contains controls for session management and agent switching.
61
+
62
+ 1. **Session Management:**
63
+ - **Auto-Save Session:** A toggle to enable or disable automatic saving of chat history to a server-side file after each message or action.
64
+ - **Custom Session Filename:** An input field to specify a custom filename for saving the session (stored in the ``chats`` directory).
65
+ - **Save Session (JSON):** A download button to save the current chat history as a JSON file locally.
66
+ - **Restore Session (JSON):** A file uploader to load a previously saved JSON session file into the current chat.
67
+ - **Available Sessions:** A list of saved session files in the ``chats`` directory, with options to load or delete them. Note: The active session file cannot be deleted.
68
+ - **Help Section:** An expandable section explaining session saving and restoring functionalities.
69
+
70
+ 2. **Agent Switching:**
71
+ - **Select Alias:** A dropdown to choose a profile (alias) for accessing specific API configurations.
72
+ - **Enter Project ID:** An input field for specifying the project ID to list available agents.
73
+ - **Select Agent:** A dropdown to pick an agent from the list retrieved based on the alias and project ID.
74
+ - **Agent Description Preview:** Displays a brief description of the selected agent (if available).
75
+ - **Recent Agents:** A list of recently used agents for quick switching.
76
+ - **Confirmation for Switching:** Prompts the user to confirm before switching to a new agent, which starts a fresh session in a new tab.
77
+ - **Help Section:** An expandable section explaining the agent switching process.
78
+
79
+ Usage Instructions
80
+ ------------------
81
+
82
+ 1. **Launching the GUI:**
83
+ - Run the command ``geai chat agent --agent-name <agent_name> --gui`` to start the Streamlit interface for the specified agent.
84
+ - The browser will open automatically (if configured) or provide a URL to access the interface.
85
+
86
+ 2. **Chatting with an Agent:**
87
+ - Type your message in the chat input field at the bottom of the main window and press Enter.
88
+ - The agent's response will stream in real-time in the chat window.
89
+ - Use the "Complete Answer" button if the agent's response seems incomplete.
90
+ - Search through the chat history using the search bar above the chat window.
91
+ - Edit your last message by clicking the edit button (✏️) next to it, modify the content, and save to regenerate the agent's response.
92
+
93
+ 3. **Managing Sessions:**
94
+ - Enable "Auto-Save Session" in the sidebar to automatically save chat history to a server-side file.
95
+ - Specify a custom filename for the session if desired.
96
+ - Download the current session as a JSON file using the "Save Session (JSON)" button.
97
+ - Upload a previously saved JSON file to restore a session using the file uploader.
98
+ - View and manage saved sessions under "Available Sessions" (load or delete files as needed).
99
+
100
+ 4. **Switching Agents:**
101
+ - In the sidebar under "Switch Agent", select an alias and enter a project ID to list available agents.
102
+ - Choose an agent from the dropdown and review its description (if available).
103
+ - Confirm the switch to start a new session with the selected agent in a new tab.
104
+ - Alternatively, switch to a recently used agent directly from the "Recent Agents" list.
105
+
106
+ 5. **Resetting the Chat:**
107
+ - Click the "Reset Chat" button in the main interface to clear the current session and start fresh with the agent's introduction.
108
+
109
+ File Storage
110
+ ------------
111
+
112
+ - **Default Session Files:** Chat sessions are saved by default in the ``chats`` directory with filenames in the format ``chat_session_<agent_name>_<YYYY-MM-DD>.json``.
113
+ - **Custom Filenames:** Users can specify custom filenames via the sidebar, which are also stored in the ``chats`` directory.
114
+ - **Recent Agents:** A list of recently used agents is saved in ``recent_agents.json`` for quick access across sessions.
115
+
116
+ Troubleshooting
117
+ ---------------
118
+
119
+ - **Agent Not Found:** If the specified agent does not exist, an error message will be displayed. Verify the agent name or ID and try again.
120
+ - **Session File Errors:** Errors during saving or loading session files are logged and displayed as Streamlit error messages. Ensure the ``chats`` directory has appropriate read/write permissions.
121
+ - **Unexpected Errors:** Any unhandled exceptions are logged and displayed in the GUI. Contact support at ``geai-sdk@globant.com`` for assistance.
@@ -0,0 +1,126 @@
1
+ geai - cli examples
2
+ ===================
3
+
4
+ In this section, you can find examples of commands using the geai utility to perform basic tasks in GEAI.
5
+
6
+ # Display help
7
+
8
+ .. code-block:: shell
9
+
10
+ geai h
11
+
12
+ .. code-block:: shell
13
+
14
+ geai org h
15
+
16
+ .. code-block:: shell
17
+
18
+ geai ast h
19
+
20
+
21
+ .. code-block:: shell
22
+
23
+ geai chat h
24
+
25
+
26
+ # Create project
27
+
28
+ .. code-block:: shell
29
+
30
+ geai org create-project \
31
+ -n "SDKTest2" \
32
+ -e "geai-sdk@globant.com" \
33
+ -d "Test project for SDK"
34
+
35
+ # Update project
36
+
37
+ .. code-block:: shell
38
+
39
+ geai org update-project \
40
+ --id 12345678-1234-1234-1234-123456789abc \
41
+ --name "SDK Test 3" \
42
+ --description "Test description"
43
+
44
+ # List projects
45
+
46
+ .. code-block:: shell
47
+
48
+ geai org list-projects
49
+
50
+ .. code-block:: shell
51
+
52
+ geai org list-projects -d full
53
+
54
+ # Get tokens from organization
55
+
56
+ .. code-block:: shell
57
+
58
+ geai org get-tokens --id aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
59
+
60
+ # List assistants
61
+
62
+ .. code-block:: shell
63
+
64
+ geai org list-assistants
65
+
66
+ # Get assistant information
67
+
68
+ .. code-block:: shell
69
+
70
+ geai ast get-assistant --id 11111111-2222-3333-4444-555555555555
71
+
72
+ # Chat with assistant
73
+
74
+ .. code-block:: shell
75
+
76
+ geai ast chat \
77
+ --name "Welcome data Assistant" \
78
+ --msg '[{"role": "user", "content": "Translate the phrase free software is the software that protects users freedoms"}, {"role": "user", "content": "now translate to french"]'
79
+
80
+
81
+ # Create assistant
82
+
83
+ .. code-block:: shell
84
+
85
+ geai ast create-assistant \
86
+ --type chat \
87
+ --name "Welcome data Assistant 3" \
88
+ --prompt "Translate to French" \
89
+ --wd-title "Assistant with WelcomeData" \
90
+ --wd-description "It is to test WelcomeData" \
91
+ --wd-feature '[{"title": "First Feature", "description": "First Feature Description"}, {"title": "Second Feature", "description": "Second Feature Description"}]' \
92
+ --wd-example-prompt '{"title": "First Prompt Example", "description": "First Prompt Example Description", "prompt_text": "You are an assistant specialized in translating"}'
93
+
94
+
95
+ # Update assistant
96
+
97
+ .. code-block:: shell
98
+
99
+ geai ast update-assistant \
100
+ --assistant-id 99999999-8888-7777-6666-555555555555 \
101
+ --action savePublishNewRevision \
102
+ --prompt "translate the following text to Latin" \
103
+ --provider-name "openai" \
104
+ --model-name "gpt-3.5-turbo" \
105
+ --temperature 0.0 \\n --wd-title "Assistant with WelcomeData" \
106
+ --wd-description "It is to test WelcomeData" \
107
+ --wd-feature "Second Feature: Second Feature Description" \
108
+ --wd-feature "First Feature: First Feature Description" \
109
+ --wd-example-prompt "First Prompt Example: First Prompt Example Description: You are an assistant specialized in translating"
110
+
111
+ # Delete assistant
112
+
113
+ .. code-block:: shell
114
+
115
+ geai ast delete-assistant --id 99999999-8888-7777-6666-555555555555
116
+
117
+
118
+ # Chat completion
119
+
120
+ .. code-block:: shell
121
+
122
+ geai chat completion \
123
+ --model "saia:assistant:Welcome data Assistant 3" \
124
+ --msg '[{"role": "user", "content": "Translate the phrase free software is the software that protects users freedoms"}, {"role": "user", "content": "now translate to french and italian"}]' \
125
+ --stream 0
126
+
@@ -0,0 +1,188 @@
1
+ PyGEAI Debugger
2
+ ===============
3
+
4
+ Overview
5
+ --------
6
+
7
+ ``geai-dbg`` is a command-line debugger for the ``geai`` CLI tool, part of the ``pygeai`` package. It allows developers to pause execution at specified points (breakpoints) in the ``geai`` codebase, inspect local variables, execute arbitrary Python code in the current context, and control program flow interactively. Breakpoints can be set by module or function name, providing flexibility for debugging complex CLI workflows.
8
+
9
+ The debugger is invoked by running the ``geai-dbg`` command, typically with the same arguments as the ``geai`` CLI. It pauses execution at predefined or user-specified breakpoints, presenting an interactive prompt ``(geai-dbg)`` for issuing commands.
10
+
11
+ Installation and Setup
12
+ ---------------------
13
+
14
+ ``geai-dbg`` is included in the ``pygeai`` package. Ensure ``pygeai`` is installed in your Python environment:
15
+
16
+ .. code-block:: bash
17
+
18
+ pip install pygeai
19
+
20
+ No additional setup is required. The debugger script (``debugger.py``) is located in the ``pygeai.dbg`` module and can be invoked via the ``geai-dbg`` command.
21
+
22
+ Usage
23
+ -----
24
+
25
+ To use ``geai-dbg``, run it with the same arguments you would pass to the ``geai`` CLI. For example:
26
+
27
+ .. code-block:: bash
28
+
29
+ geai-dbg ail lrs
30
+
31
+ This command runs the ``geai`` CLI with the arguments ``ail lrs`` under the debugger. The debugger automatically sets a breakpoint at the ``main`` function in the ``pygeai.cli.geai`` module, pausing execution before the ``geai`` command processes the arguments.
32
+
33
+ Upon hitting a breakpoint, the debugger displays:
34
+
35
+ - The location (module and function) where execution is paused.
36
+ - Local variables in the current context.
37
+ - An interactive prompt ``(geai-dbg)`` for entering commands.
38
+
39
+ You can then inspect variables, add breakpoints, execute code, or control execution using the available commands.
40
+
41
+ Commands
42
+ --------
43
+
44
+ At the ``(geai-dbg)`` prompt, the following commands are available:
45
+
46
+ continue, c
47
+ Resume execution until the next breakpoint is hit or the program completes.
48
+
49
+ quit, q, Ctrl+D
50
+ Exit the debugger, terminating the program with a clean exit status (0).
51
+
52
+ run, r
53
+ Run the program to completion, disabling all breakpoints and skipping further pauses.
54
+
55
+ breakpoint-module, bm
56
+ Add a breakpoint for a specific module. Prompts for a module name (e.g., ``pygeai.cli.commands``). Press Enter to set a wildcard breakpoint (any module).
57
+
58
+ breakpoint-function, bf
59
+ Add a breakpoint for a specific function, optionally scoped to a module. Prompts for a function name (e.g., ``main``) and an optional module name. Press Enter for wildcards (any function or module).
60
+
61
+ list-modules, lm
62
+ List all loaded modules starting with ``pygeai``, useful for identifying valid module names for breakpoints.
63
+
64
+ help, h
65
+ Display a list of available commands and their descriptions.
66
+
67
+ <Python code>
68
+ Execute arbitrary Python code in the current context. For example, ``print(sys.argv)`` displays the command-line arguments. Errors are caught and logged without crashing the debugger.
69
+
70
+ Ctrl+C
71
+ Interrupt the current command input and resume execution, equivalent to ``continue``.
72
+
73
+ Examples
74
+ --------
75
+
76
+ **Example 1: Debugging a geai Command**
77
+
78
+ Suppose you want to debug the ``geai ail lrs`` command to inspect its execution. Run:
79
+
80
+ .. code-block:: bash
81
+
82
+ geai-dbg ail lrs
83
+
84
+ Output:
85
+
86
+ .. code-block:: text
87
+
88
+ 2025-05-12 15:04:57,263 - geai - INFO - GEAI debugger started.
89
+ 2025-05-12 15:04:57,263 - geai - INFO - geai module: pygeai.cli.geai
90
+ 2025-05-12 15:04:57,263 - geai - INFO - Breakpoint added: pygeai.cli.geai:main
91
+ 2025-05-12 15:04:57,264 - geai - INFO - Setting trace and running geai
92
+ 2025-05-12 15:04:57,264 - geai - INFO - Breakpoint hit at pygeai.cli.geai.main
93
+ 2025-05-12 15:04:57,264 - geai - INFO - Local variables: {}
94
+
95
+ Paused at pygeai.cli.geai.main
96
+ Enter commands to execute in the current context (type 'continue' to resume, 'quit' to exit, 'help' to display available commands):
97
+ (geai-dbg)
98
+
99
+ List available commands:
100
+
101
+ .. code-block:: text
102
+
103
+ (geai-dbg) h
104
+ Available commands:
105
+ continue, c: Resume execution until next breakpoint
106
+ quit, q: Exit the debugger
107
+ run, r: Run program without further pauses
108
+ breakpoint-module, bm: Add a module breakpoint
109
+ breakpoint-function, bf: Add a function breakpoint
110
+ list-modules, lm: List available modules
111
+ <Python code>: Execute arbitrary Python code in the current context
112
+
113
+ List modules to find valid breakpoint targets:
114
+
115
+ .. code-block:: text
116
+
117
+ (geai-dbg) lm
118
+ 2025-05-12 15:05:03,595 - geai - INFO - Listing available modules
119
+ Available modules: ['pygeai', 'pygeai.dbg', 'pygeai.cli', ...]
120
+
121
+ Continue to the next breakpoint (e.g., another hit on ``main`` in a different context):
122
+
123
+ .. code-block:: text
124
+
125
+ (geai-dbg) c
126
+ 2025-05-12 15:05:18,424 - geai - DEBUG - Alias: default
127
+ 2025-05-12 15:05:18,424 - geai - DEBUG - Base URL: api.beta.saia.ai/
128
+ 2025-05-12 15:05:18,425 - geai - INFO - Breakpoint hit at pygeai.cli.geai.main
129
+ 2025-05-12 15:05:18,425 - geai - INFO - Local variables: {'self': <pygeai.cli.geai.CLIDriver object at 0x100f34080>, 'args': None}
130
+
131
+ Paused at pygeai.cli.geai.main
132
+ Enter commands to execute in the current context (type 'continue' to resume, 'quit' to exit, 'help' to display available commands):
133
+ (geai-dbg)
134
+
135
+ Run the program to completion:
136
+
137
+ .. code-block:: text
138
+
139
+ (geai-dbg) run
140
+ 2025-05-12 15:05:21,221 - geai - INFO - Running program without further pauses.
141
+ 2025-05-12 15:05:21,222 - geai - DEBUG - Running geai with: /path/to/venv/bin/geai-dbg ail lrs
142
+ 2025-05-12 15:05:21,222 - geai - DEBUG - Listing reasoning strategies
143
+ [geai output listing reasoning strategies]
144
+ 2025-05-12 15:05:21,878 - geai - INFO - Cleaning up trace
145
+
146
+ **Example 2: Inspecting Variables**
147
+
148
+ At a breakpoint, inspect command-line arguments:
149
+
150
+ .. code-block:: text
151
+
152
+ (geai-dbg) print(sys.argv)
153
+ 2025-05-12 15:05:21,300 - geai - INFO - Executing interactive command: print(sys.argv)
154
+ ['/path/to/venv/bin/geai-dbg', 'ail', 'lrs']
155
+
156
+ **Example 3: Adding a Breakpoint**
157
+
158
+ Add a breakpoint for the ``pygeai.cli.commands`` module:
159
+
160
+ .. code-block:: text
161
+
162
+ (geai-dbg) bm
163
+ 2025-05-12 15:05:21,400 - geai - INFO - Adding breakpoint on module
164
+ (geai-dbg) Enter module name (or press Enter for any module): pygeai.cli.commands
165
+ 2025-05-12 15:05:21,500 - geai - INFO - Breakpoint added: pygeai.cli.commands:*
166
+
167
+ Notes
168
+ -----
169
+
170
+ - **Ctrl+D and Ctrl+C**:
171
+ - Pressing ``Ctrl+D`` at the ``(geai-dbg)`` prompt terminates the debugger gracefully, logging "Debugger terminated by user (EOF)." and exiting with status 0.
172
+ - Pressing ``Ctrl+C`` resumes execution, equivalent to the ``continue`` command.
173
+
174
+ - **Python Code Execution**:
175
+ - Arbitrary Python code executed at the prompt runs in the context of the paused frame, with access to local and global variables. Use with caution, as it can modify program state.
176
+
177
+ - **Breakpoint Wildcards**:
178
+ - Use ``bm`` or ``bf`` with empty inputs to set wildcard breakpoints, pausing on any module or function. This is useful for exploratory debugging.
179
+
180
+ - **Logging**:
181
+ - The debugger logs to stdout with timestamps, including breakpoint hits, local variables, and command execution. Errors in Python code execution are logged without crashing the debugger.
182
+
183
+ For issues or feature requests, contact the ``pygeai`` development team.
184
+
185
+ .. seealso::
186
+
187
+ - ``geai`` CLI documentation for details on the underlying command-line tool.
188
+ - Python's ``sys.settrace`` documentation for technical details on the debugging mechanism.
@@ -0,0 +1,67 @@
1
+ Introduction
2
+ ============
3
+
4
+ About SDKs
5
+ ----------
6
+ An SDK (Software Development Kit) is a set of tools, libraries, documentation, code samples, processes and guides that
7
+ developers use to create software applications for a specific platform or service.
8
+ SDKs simplify the integration process by providing pre-built functionality and standardized methods for interfacing with APIs or systems.
9
+
10
+ - Tools: compilers, debuggers and other utilities
11
+ - Libraries: Collection of pre-written code that can be integrated into an application to extend its functionality.
12
+ - Documentation: Guides, API references, tutorials and best practices for using the SDK.
13
+ - Code samples: Snippets demonstrating how to use the SDK’s features
14
+ - Processes: Guidelines on how to develop, test and deploy applications using the SDK
15
+
16
+ The goal of `PyGEA </pygeai>`_ is to provide this set of resources in order to interact with `Globant Enterprise AI <https://wiki.genexus.com/enterprise-ai/wiki?8,Table+of+contents%3AEnterprise+AI>`_.
17
+
18
+ Requirements
19
+ ------------
20
+ The SDK was designed to comply with the following requirements:
21
+
22
+ - Cross-platform: It runs on MacOS, Windows, Linux distributions and BSD variants.
23
+ - Easy to install: It offers ease of installation through pip or as an individual package.
24
+ - Easy to set up: It offers assistance during the setup process.
25
+ - Intuitive: Flags and options resemble those available in similar tools in order to provide a familiar interface to work with.
26
+ - Common use cases can be accomplished in a few steps.
27
+ - Native look for any Python developer, including naming conventions, style, etc.
28
+ - Comprehensive test suite to ensure reliability and consistency across releases.
29
+
30
+ Architecture
31
+ ------------
32
+ The SDK is composed of libraries (libs), code samples, and documentation. The command-line utility interacts with the SDK to facilitate tasks. The geai-chat utility provides an interactive experience when dealing with the cli utility.
33
+ The lower level of the SDK handles interaction with the APIs available in Globant Enterprise AI.
34
+
35
+ Tools
36
+ -----
37
+ - geai-cli is the command-line utility through which you can interact with the SDK libraries.
38
+ - geai-chat is an interactive tool to perform common tasks with the Globant Enterprise AI in an automated manner.
39
+ - geai-dbg is a debugging tool that provides a detailed view of what the SDK is doing in order to find and fix any issues.
40
+
41
+ Libraries
42
+ ---------
43
+
44
+ The user can import the different modules from the libraries in order to interact with GEAI services. The proposed structure for the libraries and tools is as follows
45
+
46
+ - pygeai: Meta-package that encapsulates all the components of the SDK.
47
+ - pygeai-cli: Command-line tool to interact with the SDK.
48
+ - pygeai-chat: Interactive version of the cli tool.
49
+ - pygeai-dbg: Debugger to deal with potential issues in the SDK and have a detailed view of what it’s doing.
50
+ - pygeai-core: To handle interaction with base components of Globant Enterprise AI. Also, to handle users, groups, permissions, API Tokens, etc.
51
+ - pygeai-organization: To handle `Organizations <https://wiki.genexus.com/enterprise-ai/wiki?42,Globant+Enterprise+AI+Backoffice#Organization+Options>`_, `Projects <https://wiki.genexus.com/enterprise-ai/wiki?565,Projects>`_, etc.
52
+ - pygeai-agent: To handle interactions with Agent Studio.
53
+ - pygeai-assistant: To handle interaction with `Data Analyst Assistants <https://wiki.genexus.com/enterprise-ai/wiki?886,Data+Analyst+Assistant+2.0>`_, `RAG Assistants <https://wiki.genexus.com/enterprise-ai/wiki?44,RAG+Assistants+Introduction>`_, `Chat with Data Assistants <https://wiki.genexus.com/enterprise-ai/wiki?159,Chat+with+Data+Assistant>`_, `Chat with API Assistants <https://wiki.genexus.com/enterprise-ai/wiki?110,API+Assistant>`_, and `Chat Assistants <https://wiki.genexus.com/enterprise-ai/wiki?708,Chat+Assistant>`_.
54
+ - pygeai-flows: To handle interactions with `Flows <https://wiki.genexus.com/enterprise-ai/wiki?321,Flows+in+Globant+Enterprise+AI>`_.
55
+
56
+ Samples
57
+ -------
58
+
59
+ Code samples should illustrate how to use each module at a high level, including additional references to appropriate documentation when deeper understanding is required.
60
+
61
+ Documentation
62
+ -------------
63
+
64
+ The following basic documents are available to help you get started:
65
+
66
+ - `Quickstart </docs/source/content/quickstart.rst>`_: A simple guide showing the process of installing, configuring and starting the SDK.
67
+ - `API reference </docs/source/content/api_reference.rst>`_: A detailed description of each module.
@@ -0,0 +1,7 @@
1
+ PyGEAI - Modules
2
+ ================
3
+
4
+ .. toctree::
5
+ :maxdepth: 4
6
+
7
+ content/pygeai