futureagi 0.1.1__tar.gz
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 futureagi might be problematic. Click here for more details.
- futureagi-0.1.1/LICENSE.md +16 -0
- futureagi-0.1.1/MANIFEST.in +2 -0
- futureagi-0.1.1/PKG-INFO +250 -0
- futureagi-0.1.1/README.md +224 -0
- futureagi-0.1.1/docs/__init__.py +0 -0
- futureagi-0.1.1/fi/__init__.py +1 -0
- futureagi-0.1.1/fi/bounded_executor.py +33 -0
- futureagi-0.1.1/fi/client.py +311 -0
- futureagi-0.1.1/fi/examples/__init__.py +0 -0
- futureagi-0.1.1/fi/examples/rag_file.py +29 -0
- futureagi-0.1.1/fi/utils/__init__.py +1 -0
- futureagi-0.1.1/fi/utils/constants.py +27 -0
- futureagi-0.1.1/fi/utils/errors.py +132 -0
- futureagi-0.1.1/fi/utils/logging.py +47 -0
- futureagi-0.1.1/fi/utils/types.py +215 -0
- futureagi-0.1.1/fi/utils/utils.py +9 -0
- futureagi-0.1.1/futureagi.egg-info/PKG-INFO +250 -0
- futureagi-0.1.1/futureagi.egg-info/SOURCES.txt +21 -0
- futureagi-0.1.1/futureagi.egg-info/dependency_links.txt +1 -0
- futureagi-0.1.1/futureagi.egg-info/requires.txt +12 -0
- futureagi-0.1.1/futureagi.egg-info/top_level.txt +2 -0
- futureagi-0.1.1/setup.cfg +4 -0
- futureagi-0.1.1/setup.py +22 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Copyright (c) 2020,The Future Company(tfc)
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
+
|
|
8
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
+
|
|
10
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
14
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
15
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
16
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
futureagi-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: futureagi
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: We help GenAI teams maintain high-accuracy for their Models in production.
|
|
5
|
+
Home-page: https://github.com/future-agi/clients
|
|
6
|
+
Author: FutureAgi
|
|
7
|
+
Author-email: garvit.sapra@futureagi.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.6
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE.md
|
|
14
|
+
Requires-Dist: certifi==2024.6.2
|
|
15
|
+
Requires-Dist: charset-normalizer==3.3.2
|
|
16
|
+
Requires-Dist: idna==3.7
|
|
17
|
+
Requires-Dist: numpy==1.26.4
|
|
18
|
+
Requires-Dist: pandas==2.2.2
|
|
19
|
+
Requires-Dist: python-dateutil==2.9.0.post0
|
|
20
|
+
Requires-Dist: pytz==2024.1
|
|
21
|
+
Requires-Dist: requests==2.32.3
|
|
22
|
+
Requires-Dist: requests-futures==1.0.1
|
|
23
|
+
Requires-Dist: six==1.16.0
|
|
24
|
+
Requires-Dist: tzdata==2024.1
|
|
25
|
+
Requires-Dist: urllib3==2.2.2
|
|
26
|
+
|
|
27
|
+
# My Project
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
Welcome to Future Agi project!
|
|
32
|
+
|
|
33
|
+
# Overview
|
|
34
|
+
|
|
35
|
+
We help GenAI teams maintain high-accuracy for their Models in production
|
|
36
|
+
Purpose Built, Scalable & 10X faster than traditional methods
|
|
37
|
+
|
|
38
|
+
We know that GenAI teams struggle with ensuring optimal performance in production. We are simplifying this by streamlining the process and empowering AI teams to focus on what they do best—developing exceptional AI models
|
|
39
|
+
|
|
40
|
+
Get evaluation without
|
|
41
|
+
Human-in-the-Loop or Ground Truth
|
|
42
|
+
|
|
43
|
+
Performance Score for each output:
|
|
44
|
+
|
|
45
|
+
Why send every GenAI output to a big QA team (Human-in-th-loop). FutureAGI lets you score your outputs immediately without subject-matter-experts presence. Your QA team can now focus on much more important tasks instead of evaluating your AI app’s output. Get their QA copilot and free upto 10X bandwidth
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
Analytics of Errors
|
|
49
|
+
Why analyse the errors manually in an excel, when you can get ready-to-use insights in form of error-enalytics. For all errors, our system tags the type, and can segment and analyse which specific topics or categories are showing errors and where re-training might be required.
|
|
50
|
+
|
|
51
|
+
Configurable metrics
|
|
52
|
+
Why restrict to standard metrics like relevance for every use case? Only you know what metrics matter for your app. FutureAGI allows you to create your own custom metrics to evaluate your GenAI model’s accuracy. Quantified score for what is important to you.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## Quickstart
|
|
56
|
+
**Installation**
|
|
57
|
+
|
|
58
|
+
To install the client, you can clone the repository or install the library:
|
|
59
|
+
|
|
60
|
+
Install the library in an environment using Python >= 3.6.
|
|
61
|
+
```
|
|
62
|
+
$ pip3 install fagi-tcs
|
|
63
|
+
```
|
|
64
|
+
Or clone the repo:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
$ git clone https://github.com/future-agi/clients
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Initialisation**
|
|
71
|
+
To initialise the Fi AI Client, you need to provide your api_key and secret_key, which are associated with your Fi AI account.
|
|
72
|
+
|
|
73
|
+
Get your service API key When you create an account, we generate a service API key. You will need this API Key and your Space Key for logging authentication.
|
|
74
|
+
Instrument your code Python Client If you are using the Future Agi python client, add a few lines to your code to log your data. Logs are sent to us asynchronously.
|
|
75
|
+
from fi_client import Client
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
api_key = os.environ["FI_API_KEY"]
|
|
79
|
+
secret_key = os.environ["FI_SECRET_KEY"]
|
|
80
|
+
base_url = os.environ["FI_API_URL"]
|
|
81
|
+
|
|
82
|
+
client = Client(api_key=api_key, secret_key=secret_key,
|
|
83
|
+
uri=base_url,
|
|
84
|
+
max_workers=8,
|
|
85
|
+
max_queue_bound=5000,
|
|
86
|
+
timeout=200,
|
|
87
|
+
additional_headers=None,
|
|
88
|
+
)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Initializes the Fi Client**
|
|
92
|
+
api_key: provided API key associated with your account.
|
|
93
|
+
secret_key:provided identifier to connect records to spaces.
|
|
94
|
+
uri: RI to send your records to Fi AI.
|
|
95
|
+
max_workers: maximum number of concurrent requests to Fi. Defaults to 8.
|
|
96
|
+
max_queue_bound: maximum number of concurrent future objects generated for publishing to Fi. Defaults to 5000.
|
|
97
|
+
timeout: how long to wait for the server to send data before giving up. Defaults to 200.
|
|
98
|
+
additional_headers: Dictionary of additional headers to append to request
|
|
99
|
+
|
|
100
|
+
You can also set these keys as environment variables:
|
|
101
|
+
```
|
|
102
|
+
export FI_API_KEY=your_api_key
|
|
103
|
+
export FI_SECRET_KEY=your_secret_key
|
|
104
|
+
```
|
|
105
|
+
And then initialise the client without passing the keys directly:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
from fi.utils.types import ModelTypes, Environments
|
|
109
|
+
|
|
110
|
+
client.log(
|
|
111
|
+
model_id="your_model_id",
|
|
112
|
+
model_type=ModelTypes.GENERATIVE_LLM,
|
|
113
|
+
environment=Environments.PRODUCTION,
|
|
114
|
+
model_version="1.0.0",
|
|
115
|
+
prediction_timestamp=1625216400,
|
|
116
|
+
conversation={
|
|
117
|
+
"chat_history": [
|
|
118
|
+
{"role": "user", "content": "How do I implement a neural network in Python?"}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
tags={"project": "AI project"}
|
|
122
|
+
)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Parameters**
|
|
126
|
+
• model_id: The ID of the model. Must be a string.
|
|
127
|
+
• model_type: The type of the model. Must be an instance of ModelTypes.
|
|
128
|
+
• environment: The environment in which the model is running. Must be an instance of Environments.
|
|
129
|
+
• model_version: The version of the model. Must be a string.
|
|
130
|
+
• prediction_timestamp: (Optional) The timestamp of the prediction. Must be an integer.
|
|
131
|
+
• conversation: The conversation data. Must be a dictionary containing either chat_history or chat_graph.
|
|
132
|
+
• tags: (Optional) Additional tags for the event. Must be a dictionary.
|
|
133
|
+
|
|
134
|
+
**Conversation Format**
|
|
135
|
+
|
|
136
|
+
**Chat History**
|
|
137
|
+
The chat_history must be a list of dictionaries with the following keys:
|
|
138
|
+
• role: The role of the participant (e.g., “user”, “assistant”). Must be a string.
|
|
139
|
+
• content: The content of the message. Must be a string.
|
|
140
|
+
• context: (Optional) The context of the message. Must be a list of pairs of strings in the format [["", ""]...].
|
|
141
|
+
|
|
142
|
+
**Chat History with conversation ID**
|
|
143
|
+
The chat_history must be a list of dictionaries with the following keys:
|
|
144
|
+
• conversation_id: The ID of the conversation. Must be a string.
|
|
145
|
+
• role: The role of the participant (e.g., “user”, “assistant”). Must be a string.
|
|
146
|
+
• content: The content of the message. Must be a string.
|
|
147
|
+
• context: (Optional) The context of the message. Must be a list of pairs of strings in the format [["", ""]...].
|
|
148
|
+
|
|
149
|
+
**Chat Graph**
|
|
150
|
+
The chat_graph must be a dictionary with the following keys:
|
|
151
|
+
• conversation_id: The ID of the conversation. Must be a string.
|
|
152
|
+
• nodes: A list of nodes, each containing:
|
|
153
|
+
• message: A dictionary with the message details.
|
|
154
|
+
• node_id: The ID of the node. Must be a string.
|
|
155
|
+
• parent_id: The ID of the parent node. Must be a string.
|
|
156
|
+
• timestamp: The timestamp of the node. Must be an integer.
|
|
157
|
+
|
|
158
|
+
**Error Handling**
|
|
159
|
+
The client raises specific exceptions for different types of errors:
|
|
160
|
+
• AuthError: Raised if the API key or secret key is missing.
|
|
161
|
+
• InvalidAdditionalHeaders: Raised if there are conflicting additional headers.
|
|
162
|
+
• InvalidValueType: Raised if a parameter has an invalid type.
|
|
163
|
+
• InvalidSupportedType: Raised if a model type is not supported.
|
|
164
|
+
• MissingRequiredKey: Raised if a required key is missing.
|
|
165
|
+
• InvalidVectorLength: Raised if the vector length is invalid.
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
1. **Logging data individually:** For example, "chat_history" may include a list of dictionaries where each dictionary represents a message with attributes like "role" (str) and "content" (str) .
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
{
|
|
173
|
+
"chat_history": [
|
|
174
|
+
{
|
|
175
|
+
"role": "system",
|
|
176
|
+
"content": "You are a helpful assistant."
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"role": "user",
|
|
180
|
+
"content": "Who won the world series in 2020?"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"role": "assistant",
|
|
184
|
+
"content": "The Los Angeles Dodgers won the World Series in 2020."
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
1. **Logging data all at once:** This involves logging structured conversations in a unified format:
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
[{
|
|
194
|
+
"conversation_id": "",
|
|
195
|
+
"title": "",
|
|
196
|
+
"root_node": "",
|
|
197
|
+
"metadata": {},
|
|
198
|
+
"nodes": [{
|
|
199
|
+
"parent_node": "",
|
|
200
|
+
"child_node": "",
|
|
201
|
+
"message": {
|
|
202
|
+
"id": "",
|
|
203
|
+
"author": {
|
|
204
|
+
"role": "assistant",
|
|
205
|
+
"metadata": {}
|
|
206
|
+
},
|
|
207
|
+
"content": {
|
|
208
|
+
"content_type": "text",
|
|
209
|
+
"parts": [
|
|
210
|
+
"The user is interested to do this task..."
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
"context": ""
|
|
214
|
+
}
|
|
215
|
+
}]
|
|
216
|
+
}]
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
# FAQ’s:
|
|
222
|
+
|
|
223
|
+
1. How do you give a performance score without human in the loop?
|
|
224
|
+
Our secret Sauce is a Critique AI agent that cana deliver powerful evaluation framework without need for human in the loop. What’s more is that it is 100% configurable as per new evolving use cases. Now anything that you canimagine your AI system should deliver - you can configure our platform to manage it.
|
|
225
|
+
|
|
226
|
+
2. What all inputs FutureAGI platform needs?
|
|
227
|
+
We would need only the input-output database, training dataset if available, and User-analytics. We do not need to understand the model and how it is taking decisions.
|
|
228
|
+
|
|
229
|
+
3. I don't want to share data with Future AGI, can I still use it?
|
|
230
|
+
Yes, you can now intall our SDK in your private cloud and take advantage of our strong platform to align your Ai system to your users.
|
|
231
|
+
|
|
232
|
+
4. My use case is unique, would you provide service to customise your platform as per my use case?
|
|
233
|
+
Our platform if 100% customisable and easy to configure for all types of models and modalities by the AI teams. However, our customer-success engineer would be happy to assist you for figuring out solutions to your unique use cases.
|
|
234
|
+
|
|
235
|
+
5. My app uses multiple models with multiple modalities, can you work with images and videos also?
|
|
236
|
+
Yes we can.
|
|
237
|
+
|
|
238
|
+
6. How much time does it take to integrate the Future AGI platform? How much bandwidth would be required?
|
|
239
|
+
It takes just 2 minutes to integrate a few lines of code and your data starts showing on our platform. Try it today.
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
# Website
|
|
243
|
+
Visit Us At: https://www.futureagi.com/
|
|
244
|
+
Gitbook: https://futureagi.gitbook.io/future-agi/product-guides/quickstart
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# My Project
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Welcome to Future Agi project!
|
|
6
|
+
|
|
7
|
+
# Overview
|
|
8
|
+
|
|
9
|
+
We help GenAI teams maintain high-accuracy for their Models in production
|
|
10
|
+
Purpose Built, Scalable & 10X faster than traditional methods
|
|
11
|
+
|
|
12
|
+
We know that GenAI teams struggle with ensuring optimal performance in production. We are simplifying this by streamlining the process and empowering AI teams to focus on what they do best—developing exceptional AI models
|
|
13
|
+
|
|
14
|
+
Get evaluation without
|
|
15
|
+
Human-in-the-Loop or Ground Truth
|
|
16
|
+
|
|
17
|
+
Performance Score for each output:
|
|
18
|
+
|
|
19
|
+
Why send every GenAI output to a big QA team (Human-in-th-loop). FutureAGI lets you score your outputs immediately without subject-matter-experts presence. Your QA team can now focus on much more important tasks instead of evaluating your AI app’s output. Get their QA copilot and free upto 10X bandwidth
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
Analytics of Errors
|
|
23
|
+
Why analyse the errors manually in an excel, when you can get ready-to-use insights in form of error-enalytics. For all errors, our system tags the type, and can segment and analyse which specific topics or categories are showing errors and where re-training might be required.
|
|
24
|
+
|
|
25
|
+
Configurable metrics
|
|
26
|
+
Why restrict to standard metrics like relevance for every use case? Only you know what metrics matter for your app. FutureAGI allows you to create your own custom metrics to evaluate your GenAI model’s accuracy. Quantified score for what is important to you.
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## Quickstart
|
|
30
|
+
**Installation**
|
|
31
|
+
|
|
32
|
+
To install the client, you can clone the repository or install the library:
|
|
33
|
+
|
|
34
|
+
Install the library in an environment using Python >= 3.6.
|
|
35
|
+
```
|
|
36
|
+
$ pip3 install fagi-tcs
|
|
37
|
+
```
|
|
38
|
+
Or clone the repo:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
$ git clone https://github.com/future-agi/clients
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Initialisation**
|
|
45
|
+
To initialise the Fi AI Client, you need to provide your api_key and secret_key, which are associated with your Fi AI account.
|
|
46
|
+
|
|
47
|
+
Get your service API key When you create an account, we generate a service API key. You will need this API Key and your Space Key for logging authentication.
|
|
48
|
+
Instrument your code Python Client If you are using the Future Agi python client, add a few lines to your code to log your data. Logs are sent to us asynchronously.
|
|
49
|
+
from fi_client import Client
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
api_key = os.environ["FI_API_KEY"]
|
|
53
|
+
secret_key = os.environ["FI_SECRET_KEY"]
|
|
54
|
+
base_url = os.environ["FI_API_URL"]
|
|
55
|
+
|
|
56
|
+
client = Client(api_key=api_key, secret_key=secret_key,
|
|
57
|
+
uri=base_url,
|
|
58
|
+
max_workers=8,
|
|
59
|
+
max_queue_bound=5000,
|
|
60
|
+
timeout=200,
|
|
61
|
+
additional_headers=None,
|
|
62
|
+
)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Initializes the Fi Client**
|
|
66
|
+
api_key: provided API key associated with your account.
|
|
67
|
+
secret_key:provided identifier to connect records to spaces.
|
|
68
|
+
uri: RI to send your records to Fi AI.
|
|
69
|
+
max_workers: maximum number of concurrent requests to Fi. Defaults to 8.
|
|
70
|
+
max_queue_bound: maximum number of concurrent future objects generated for publishing to Fi. Defaults to 5000.
|
|
71
|
+
timeout: how long to wait for the server to send data before giving up. Defaults to 200.
|
|
72
|
+
additional_headers: Dictionary of additional headers to append to request
|
|
73
|
+
|
|
74
|
+
You can also set these keys as environment variables:
|
|
75
|
+
```
|
|
76
|
+
export FI_API_KEY=your_api_key
|
|
77
|
+
export FI_SECRET_KEY=your_secret_key
|
|
78
|
+
```
|
|
79
|
+
And then initialise the client without passing the keys directly:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
from fi.utils.types import ModelTypes, Environments
|
|
83
|
+
|
|
84
|
+
client.log(
|
|
85
|
+
model_id="your_model_id",
|
|
86
|
+
model_type=ModelTypes.GENERATIVE_LLM,
|
|
87
|
+
environment=Environments.PRODUCTION,
|
|
88
|
+
model_version="1.0.0",
|
|
89
|
+
prediction_timestamp=1625216400,
|
|
90
|
+
conversation={
|
|
91
|
+
"chat_history": [
|
|
92
|
+
{"role": "user", "content": "How do I implement a neural network in Python?"}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
tags={"project": "AI project"}
|
|
96
|
+
)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Parameters**
|
|
100
|
+
• model_id: The ID of the model. Must be a string.
|
|
101
|
+
• model_type: The type of the model. Must be an instance of ModelTypes.
|
|
102
|
+
• environment: The environment in which the model is running. Must be an instance of Environments.
|
|
103
|
+
• model_version: The version of the model. Must be a string.
|
|
104
|
+
• prediction_timestamp: (Optional) The timestamp of the prediction. Must be an integer.
|
|
105
|
+
• conversation: The conversation data. Must be a dictionary containing either chat_history or chat_graph.
|
|
106
|
+
• tags: (Optional) Additional tags for the event. Must be a dictionary.
|
|
107
|
+
|
|
108
|
+
**Conversation Format**
|
|
109
|
+
|
|
110
|
+
**Chat History**
|
|
111
|
+
The chat_history must be a list of dictionaries with the following keys:
|
|
112
|
+
• role: The role of the participant (e.g., “user”, “assistant”). Must be a string.
|
|
113
|
+
• content: The content of the message. Must be a string.
|
|
114
|
+
• context: (Optional) The context of the message. Must be a list of pairs of strings in the format [["", ""]...].
|
|
115
|
+
|
|
116
|
+
**Chat History with conversation ID**
|
|
117
|
+
The chat_history must be a list of dictionaries with the following keys:
|
|
118
|
+
• conversation_id: The ID of the conversation. Must be a string.
|
|
119
|
+
• role: The role of the participant (e.g., “user”, “assistant”). Must be a string.
|
|
120
|
+
• content: The content of the message. Must be a string.
|
|
121
|
+
• context: (Optional) The context of the message. Must be a list of pairs of strings in the format [["", ""]...].
|
|
122
|
+
|
|
123
|
+
**Chat Graph**
|
|
124
|
+
The chat_graph must be a dictionary with the following keys:
|
|
125
|
+
• conversation_id: The ID of the conversation. Must be a string.
|
|
126
|
+
• nodes: A list of nodes, each containing:
|
|
127
|
+
• message: A dictionary with the message details.
|
|
128
|
+
• node_id: The ID of the node. Must be a string.
|
|
129
|
+
• parent_id: The ID of the parent node. Must be a string.
|
|
130
|
+
• timestamp: The timestamp of the node. Must be an integer.
|
|
131
|
+
|
|
132
|
+
**Error Handling**
|
|
133
|
+
The client raises specific exceptions for different types of errors:
|
|
134
|
+
• AuthError: Raised if the API key or secret key is missing.
|
|
135
|
+
• InvalidAdditionalHeaders: Raised if there are conflicting additional headers.
|
|
136
|
+
• InvalidValueType: Raised if a parameter has an invalid type.
|
|
137
|
+
• InvalidSupportedType: Raised if a model type is not supported.
|
|
138
|
+
• MissingRequiredKey: Raised if a required key is missing.
|
|
139
|
+
• InvalidVectorLength: Raised if the vector length is invalid.
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
1. **Logging data individually:** For example, "chat_history" may include a list of dictionaries where each dictionary represents a message with attributes like "role" (str) and "content" (str) .
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
{
|
|
147
|
+
"chat_history": [
|
|
148
|
+
{
|
|
149
|
+
"role": "system",
|
|
150
|
+
"content": "You are a helpful assistant."
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"role": "user",
|
|
154
|
+
"content": "Who won the world series in 2020?"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"role": "assistant",
|
|
158
|
+
"content": "The Los Angeles Dodgers won the World Series in 2020."
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
1. **Logging data all at once:** This involves logging structured conversations in a unified format:
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
[{
|
|
168
|
+
"conversation_id": "",
|
|
169
|
+
"title": "",
|
|
170
|
+
"root_node": "",
|
|
171
|
+
"metadata": {},
|
|
172
|
+
"nodes": [{
|
|
173
|
+
"parent_node": "",
|
|
174
|
+
"child_node": "",
|
|
175
|
+
"message": {
|
|
176
|
+
"id": "",
|
|
177
|
+
"author": {
|
|
178
|
+
"role": "assistant",
|
|
179
|
+
"metadata": {}
|
|
180
|
+
},
|
|
181
|
+
"content": {
|
|
182
|
+
"content_type": "text",
|
|
183
|
+
"parts": [
|
|
184
|
+
"The user is interested to do this task..."
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
"context": ""
|
|
188
|
+
}
|
|
189
|
+
}]
|
|
190
|
+
}]
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
# FAQ’s:
|
|
196
|
+
|
|
197
|
+
1. How do you give a performance score without human in the loop?
|
|
198
|
+
Our secret Sauce is a Critique AI agent that cana deliver powerful evaluation framework without need for human in the loop. What’s more is that it is 100% configurable as per new evolving use cases. Now anything that you canimagine your AI system should deliver - you can configure our platform to manage it.
|
|
199
|
+
|
|
200
|
+
2. What all inputs FutureAGI platform needs?
|
|
201
|
+
We would need only the input-output database, training dataset if available, and User-analytics. We do not need to understand the model and how it is taking decisions.
|
|
202
|
+
|
|
203
|
+
3. I don't want to share data with Future AGI, can I still use it?
|
|
204
|
+
Yes, you can now intall our SDK in your private cloud and take advantage of our strong platform to align your Ai system to your users.
|
|
205
|
+
|
|
206
|
+
4. My use case is unique, would you provide service to customise your platform as per my use case?
|
|
207
|
+
Our platform if 100% customisable and easy to configure for all types of models and modalities by the AI teams. However, our customer-success engineer would be happy to assist you for figuring out solutions to your unique use cases.
|
|
208
|
+
|
|
209
|
+
5. My app uses multiple models with multiple modalities, can you work with images and videos also?
|
|
210
|
+
Yes we can.
|
|
211
|
+
|
|
212
|
+
6. How much time does it take to integrate the Future AGI platform? How much bandwidth would be required?
|
|
213
|
+
It takes just 2 minutes to integrate a few lines of code and your data starts showing on our platform. Try it today.
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
# Website
|
|
217
|
+
Visit Us At: https://www.futureagi.com/
|
|
218
|
+
Gitbook: https://futureagi.gitbook.io/future-agi/product-guides/quickstart
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.1"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
2
|
+
from threading import BoundedSemaphore
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class BoundedExecutor:
|
|
6
|
+
"""BoundedExecutor behaves as a ThreadPoolExecutor which will block on
|
|
7
|
+
calls to submit() once the limit given as "bound" work items are queued for
|
|
8
|
+
execution.
|
|
9
|
+
:param bound: Integer - the maximum number of items in the work queue
|
|
10
|
+
:param max_workers: Integer - the size of the thread pool
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, bound, max_workers):
|
|
14
|
+
self.executor = ThreadPoolExecutor(max_workers=max_workers)
|
|
15
|
+
self.semaphore = BoundedSemaphore(bound + max_workers)
|
|
16
|
+
|
|
17
|
+
"""See concurrent.futures.Executor#submit"""
|
|
18
|
+
|
|
19
|
+
def submit(self, fn, *args, **kwargs):
|
|
20
|
+
self.semaphore.acquire()
|
|
21
|
+
try:
|
|
22
|
+
future = self.executor.submit(fn, *args, **kwargs)
|
|
23
|
+
except Exception:
|
|
24
|
+
self.semaphore.release()
|
|
25
|
+
raise
|
|
26
|
+
else:
|
|
27
|
+
future.add_done_callback(lambda x: self.semaphore.release())
|
|
28
|
+
return future
|
|
29
|
+
|
|
30
|
+
"""See concurrent.futures.Executor#shutdown"""
|
|
31
|
+
|
|
32
|
+
def shutdown(self, wait=True):
|
|
33
|
+
self.executor.shutdown(wait)
|