-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init update * Update terminology.rst * fix the branch to create an index.html, and fix pre-commit issues * Doc update * made several changes to the docs after Shuguang's revision * fixing pre-commit issues * fixed the reference file to the final prompt config file * added google analytics --------- Co-authored-by: Salman Paracha <[email protected]>
- Loading branch information
Showing
49 changed files
with
1,187 additions
and
611 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
sphinx_book_theme==1.1.3 | ||
sphinx_copybutton==0.5.2 | ||
sphinxawesome-theme | ||
sphinx_sitemap | ||
sphinx_design | ||
sphinxawesome_theme |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!-- _templates/analytics.html --> | ||
{% if google_analytics_id %} | ||
<!-- Google tag (gtag.js) --> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ google_analytics_id }}"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
|
||
gtag('config', '{{ google_analytics_id }}'); | ||
</script> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes.
File renamed without changes.
41 changes: 41 additions & 0 deletions
41
docs/source/build_with_arch/includes/rag/parameter_handling.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from flask import Flask, request, jsonify | ||
|
||
app = Flask(__name__) | ||
|
||
@app.route('/agent/device_summary', methods=['POST']) | ||
def get_device_summary(): | ||
""" | ||
Endpoint to retrieve device statistics based on device IDs and an optional time range. | ||
""" | ||
data = request.get_json() | ||
|
||
# Validate 'device_ids' parameter | ||
device_ids = data.get('device_ids') | ||
if not device_ids or not isinstance(device_ids, list): | ||
return jsonify({'error': "'device_ids' parameter is required and must be a list"}), 400 | ||
|
||
# Validate 'time_range' parameter (optional, defaults to 7) | ||
time_range = data.get('time_range', 7) | ||
if not isinstance(time_range, int): | ||
return jsonify({'error': "'time_range' must be an integer"}), 400 | ||
|
||
# Simulate retrieving statistics for the given device IDs and time range | ||
# In a real application, you would query your database or external service here | ||
statistics = [] | ||
for device_id in device_ids: | ||
# Placeholder for actual data retrieval | ||
stats = { | ||
'device_id': device_id, | ||
'time_range': f'Last {time_range} days', | ||
'data': f'Statistics data for device {device_id} over the last {time_range} days.' | ||
} | ||
statistics.append(stats) | ||
|
||
response = { | ||
'statistics': statistics | ||
} | ||
|
||
return jsonify(response), 200 | ||
|
||
if __name__ == '__main__': | ||
app.run(debug=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.