bluer-agent 5.5.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.
Files changed (42) hide show
  1. bluer_agent-5.5.1/LICENSE +121 -0
  2. bluer_agent-5.5.1/MANIFEST.in +1 -0
  3. bluer_agent-5.5.1/PKG-INFO +53 -0
  4. bluer_agent-5.5.1/README.md +26 -0
  5. bluer_agent-5.5.1/bluer_agent/.abcli/abcli.sh +9 -0
  6. bluer_agent-5.5.1/bluer_agent/.abcli/actions.sh +11 -0
  7. bluer_agent-5.5.1/bluer_agent/.abcli/alias.sh +4 -0
  8. bluer_agent-5.5.1/bluer_agent/.abcli/bluer_agent.sh +11 -0
  9. bluer_agent-5.5.1/bluer_agent/.abcli/chat/validate.sh +40 -0
  10. bluer_agent-5.5.1/bluer_agent/.abcli/chat.sh +15 -0
  11. bluer_agent-5.5.1/bluer_agent/.abcli/install.sh +7 -0
  12. bluer_agent-5.5.1/bluer_agent/.abcli/tests/README.sh +8 -0
  13. bluer_agent-5.5.1/bluer_agent/.abcli/tests/chat.sh +9 -0
  14. bluer_agent-5.5.1/bluer_agent/.abcli/tests/help.sh +36 -0
  15. bluer_agent-5.5.1/bluer_agent/.abcli/tests/transcription.sh +17 -0
  16. bluer_agent-5.5.1/bluer_agent/.abcli/tests/version.sh +8 -0
  17. bluer_agent-5.5.1/bluer_agent/.abcli/transcription/validate.sh +73 -0
  18. bluer_agent-5.5.1/bluer_agent/.abcli/transcription.sh +15 -0
  19. bluer_agent-5.5.1/bluer_agent/README.py +68 -0
  20. bluer_agent-5.5.1/bluer_agent/__init__.py +17 -0
  21. bluer_agent-5.5.1/bluer_agent/__main__.py +17 -0
  22. bluer_agent-5.5.1/bluer_agent/config.env +5 -0
  23. bluer_agent-5.5.1/bluer_agent/env.py +14 -0
  24. bluer_agent-5.5.1/bluer_agent/functions.py +1 -0
  25. bluer_agent-5.5.1/bluer_agent/help/__init__.py +1 -0
  26. bluer_agent-5.5.1/bluer_agent/help/__main__.py +10 -0
  27. bluer_agent-5.5.1/bluer_agent/help/chat.py +30 -0
  28. bluer_agent-5.5.1/bluer_agent/help/functions.py +7 -0
  29. bluer_agent-5.5.1/bluer_agent/help/transcription.py +49 -0
  30. bluer_agent-5.5.1/bluer_agent/host.py +11 -0
  31. bluer_agent-5.5.1/bluer_agent/logger.py +4 -0
  32. bluer_agent-5.5.1/bluer_agent/sample.env +4 -0
  33. bluer_agent-5.5.1/bluer_agent/urls.py +2 -0
  34. bluer_agent-5.5.1/bluer_agent.egg-info/PKG-INFO +53 -0
  35. bluer_agent-5.5.1/bluer_agent.egg-info/SOURCES.txt +40 -0
  36. bluer_agent-5.5.1/bluer_agent.egg-info/dependency_links.txt +1 -0
  37. bluer_agent-5.5.1/bluer_agent.egg-info/requires.txt +1 -0
  38. bluer_agent-5.5.1/bluer_agent.egg-info/top_level.txt +1 -0
  39. bluer_agent-5.5.1/pyproject.toml +6 -0
  40. bluer_agent-5.5.1/requirements.txt +1 -0
  41. bluer_agent-5.5.1/setup.cfg +4 -0
  42. bluer_agent-5.5.1/setup.py +23 -0
@@ -0,0 +1,121 @@
1
+ Creative Commons Legal Code
2
+
3
+ CC0 1.0 Universal
4
+
5
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12
+ HEREUNDER.
13
+
14
+ Statement of Purpose
15
+
16
+ The laws of most jurisdictions throughout the world automatically confer
17
+ exclusive Copyright and Related Rights (defined below) upon the creator
18
+ and subsequent owner(s) (each and all, an "owner") of an original work of
19
+ authorship and/or a database (each, a "Work").
20
+
21
+ Certain owners wish to permanently relinquish those rights to a Work for
22
+ the purpose of contributing to a commons of creative, cultural and
23
+ scientific works ("Commons") that the public can reliably and without fear
24
+ of later claims of infringement build upon, modify, incorporate in other
25
+ works, reuse and redistribute as freely as possible in any form whatsoever
26
+ and for any purposes, including without limitation commercial purposes.
27
+ These owners may contribute to the Commons to promote the ideal of a free
28
+ culture and the further production of creative, cultural and scientific
29
+ works, or to gain reputation or greater distribution for their Work in
30
+ part through the use and efforts of others.
31
+
32
+ For these and/or other purposes and motivations, and without any
33
+ expectation of additional consideration or compensation, the person
34
+ associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35
+ is an owner of Copyright and Related Rights in the Work, voluntarily
36
+ elects to apply CC0 to the Work and publicly distribute the Work under its
37
+ terms, with knowledge of his or her Copyright and Related Rights in the
38
+ Work and the meaning and intended legal effect of CC0 on those rights.
39
+
40
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
41
+ protected by copyright and related or neighboring rights ("Copyright and
42
+ Related Rights"). Copyright and Related Rights include, but are not
43
+ limited to, the following:
44
+
45
+ i. the right to reproduce, adapt, distribute, perform, display,
46
+ communicate, and translate a Work;
47
+ ii. moral rights retained by the original author(s) and/or performer(s);
48
+ iii. publicity and privacy rights pertaining to a person's image or
49
+ likeness depicted in a Work;
50
+ iv. rights protecting against unfair competition in regards to a Work,
51
+ subject to the limitations in paragraph 4(a), below;
52
+ v. rights protecting the extraction, dissemination, use and reuse of data
53
+ in a Work;
54
+ vi. database rights (such as those arising under Directive 96/9/EC of the
55
+ European Parliament and of the Council of 11 March 1996 on the legal
56
+ protection of databases, and under any national implementation
57
+ thereof, including any amended or successor version of such
58
+ directive); and
59
+ vii. other similar, equivalent or corresponding rights throughout the
60
+ world based on applicable law or treaty, and any national
61
+ implementations thereof.
62
+
63
+ 2. Waiver. To the greatest extent permitted by, but not in contravention
64
+ of, applicable law, Affirmer hereby overtly, fully, permanently,
65
+ irrevocably and unconditionally waives, abandons, and surrenders all of
66
+ Affirmer's Copyright and Related Rights and associated claims and causes
67
+ of action, whether now known or unknown (including existing as well as
68
+ future claims and causes of action), in the Work (i) in all territories
69
+ worldwide, (ii) for the maximum duration provided by applicable law or
70
+ treaty (including future time extensions), (iii) in any current or future
71
+ medium and for any number of copies, and (iv) for any purpose whatsoever,
72
+ including without limitation commercial, advertising or promotional
73
+ purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74
+ member of the public at large and to the detriment of Affirmer's heirs and
75
+ successors, fully intending that such Waiver shall not be subject to
76
+ revocation, rescission, cancellation, termination, or any other legal or
77
+ equitable action to disrupt the quiet enjoyment of the Work by the public
78
+ as contemplated by Affirmer's express Statement of Purpose.
79
+
80
+ 3. Public License Fallback. Should any part of the Waiver for any reason
81
+ be judged legally invalid or ineffective under applicable law, then the
82
+ Waiver shall be preserved to the maximum extent permitted taking into
83
+ account Affirmer's express Statement of Purpose. In addition, to the
84
+ extent the Waiver is so judged Affirmer hereby grants to each affected
85
+ person a royalty-free, non transferable, non sublicensable, non exclusive,
86
+ irrevocable and unconditional license to exercise Affirmer's Copyright and
87
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
88
+ maximum duration provided by applicable law or treaty (including future
89
+ time extensions), (iii) in any current or future medium and for any number
90
+ of copies, and (iv) for any purpose whatsoever, including without
91
+ limitation commercial, advertising or promotional purposes (the
92
+ "License"). The License shall be deemed effective as of the date CC0 was
93
+ applied by Affirmer to the Work. Should any part of the License for any
94
+ reason be judged legally invalid or ineffective under applicable law, such
95
+ partial invalidity or ineffectiveness shall not invalidate the remainder
96
+ of the License, and in such case Affirmer hereby affirms that he or she
97
+ will not (i) exercise any of his or her remaining Copyright and Related
98
+ Rights in the Work or (ii) assert any associated claims and causes of
99
+ action with respect to the Work, in either case contrary to Affirmer's
100
+ express Statement of Purpose.
101
+
102
+ 4. Limitations and Disclaimers.
103
+
104
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
105
+ surrendered, licensed or otherwise affected by this document.
106
+ b. Affirmer offers the Work as-is and makes no representations or
107
+ warranties of any kind concerning the Work, express, implied,
108
+ statutory or otherwise, including without limitation warranties of
109
+ title, merchantability, fitness for a particular purpose, non
110
+ infringement, or the absence of latent or other defects, accuracy, or
111
+ the present or absence of errors, whether or not discoverable, all to
112
+ the greatest extent permissible under applicable law.
113
+ c. Affirmer disclaims responsibility for clearing rights of other persons
114
+ that may apply to the Work or any use thereof, including without
115
+ limitation any person's Copyright and Related Rights in the Work.
116
+ Further, Affirmer disclaims responsibility for obtaining any necessary
117
+ consents, permissions or other rights required for any use of the
118
+ Work.
119
+ d. Affirmer understands and acknowledges that Creative Commons is not a
120
+ party to this document and has no duty or obligation with respect to
121
+ this CC0 or use of the Work.
@@ -0,0 +1 @@
1
+ include requirements.txt
@@ -0,0 +1,53 @@
1
+ Metadata-Version: 2.4
2
+ Name: bluer_agent
3
+ Version: 5.5.1
4
+ Summary: 👾 an AI agent.
5
+ Home-page: https://github.com/kamangir/bluer-agent
6
+ Author: Arash Abadpour (Kamangir)
7
+ Author-email: arash.abadpour@gmail.com
8
+ License: CC0-1.0
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Unix Shell
11
+ Classifier: Operating System :: OS Independent
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: bluer_ai
15
+ Dynamic: author
16
+ Dynamic: author-email
17
+ Dynamic: classifier
18
+ Dynamic: description
19
+ Dynamic: description-content-type
20
+ Dynamic: home-page
21
+ Dynamic: license
22
+ Dynamic: license-file
23
+ Dynamic: requires-dist
24
+ Dynamic: summary
25
+
26
+ # 👾 bluer-agent
27
+
28
+ 👾 `@agent` is a set of tools for interacting with LLMs.
29
+
30
+ ## installation
31
+
32
+ ```bash
33
+ pip install bluer-agent
34
+ ```
35
+
36
+ ## features
37
+
38
+ | | | |
39
+ | --- | --- | --- |
40
+ | [`feature 1`](https://github.com/kamangir/bluer-agent/blob/main/bluer_agent/docs/feature_1) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](https://github.com/kamangir/bluer-agent/blob/main/bluer_agent/docs/feature_1) description of feature 1 ... | [`feature 2`](https://github.com/kamangir/bluer-agent/blob/main/bluer_agent/docs/feature_2.md) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](https://github.com/kamangir/bluer-agent/blob/main/bluer_agent/docs/feature_2.md) description of feature 2 ... | [`feature 3`](https://github.com/kamangir/bluer-agent/blob/main/bluer_agent/docs/feature_3.md) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](https://github.com/kamangir/bluer-agent/blob/main/bluer_agent/docs/feature_3.md) description of feature 3 ... |
41
+
42
+ # aliases
43
+
44
+ [@agent](https://github.com/kamangir/bluer-agent/blob/main/bluer_agent/docs/aliases/agent.md).
45
+
46
+ ---
47
+
48
+
49
+ [![pylint](https://github.com/kamangir/bluer-agent/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/bluer-agent/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/bluer-agent/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/bluer-agent/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/bluer-agent/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/bluer-agent/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/bluer-agent.svg)](https://pypi.org/project/bluer-agent/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/bluer-agent)](https://pypistats.org/packages/bluer-agent)
50
+
51
+ built by 🌀 [`bluer README`](https://github.com/kamangir/bluer-objects/tree/main/bluer_objects/README), based on 👾 [`bluer_agent-5.5.1`](https://github.com/kamangir/bluer-agent).
52
+
53
+ built by 🌀 [`blueness-3.118.1`](https://github.com/kamangir/blueness).
@@ -0,0 +1,26 @@
1
+ # 👾 bluer-agent
2
+
3
+ 👾 `@agent` is a set of tools for interacting with LLMs.
4
+
5
+ ## installation
6
+
7
+ ```bash
8
+ pip install bluer-agent
9
+ ```
10
+
11
+ ## features
12
+
13
+ | | | |
14
+ | --- | --- | --- |
15
+ | [`feature 1`](./bluer_agent/docs/feature_1) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](./bluer_agent/docs/feature_1) description of feature 1 ... | [`feature 2`](./bluer_agent/docs/feature_2.md) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](./bluer_agent/docs/feature_2.md) description of feature 2 ... | [`feature 3`](./bluer_agent/docs/feature_3.md) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](./bluer_agent/docs/feature_3.md) description of feature 3 ... |
16
+
17
+ # aliases
18
+
19
+ [@agent](./bluer_agent/docs/aliases/agent.md).
20
+
21
+ ---
22
+
23
+
24
+ [![pylint](https://github.com/kamangir/bluer-agent/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/bluer-agent/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/bluer-agent/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/bluer-agent/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/bluer-agent/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/bluer-agent/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/bluer-agent.svg)](https://pypi.org/project/bluer-agent/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/bluer-agent)](https://pypistats.org/packages/bluer-agent)
25
+
26
+ built by 🌀 [`bluer README`](https://github.com/kamangir/bluer-objects/tree/main/bluer_objects/README), based on 👾 [`bluer_agent-5.5.1`](https://github.com/kamangir/bluer-agent).
@@ -0,0 +1,9 @@
1
+ #! /usr/bin/env bash
2
+
3
+ bluer_ai_source_caller_suffix_path /tests
4
+
5
+ bluer_ai_env_dot_load \
6
+ caller,plugin=bluer_agent,suffix=/../..
7
+
8
+ bluer_ai_env_dot_load \
9
+ caller,filename=config.env,suffix=/..
@@ -0,0 +1,11 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_agent_action_git_before_push() {
4
+ bluer_agent build_README
5
+ [[ $? -ne 0 ]] && return 1
6
+
7
+ [[ "$(bluer_ai_git get_branch)" != "main" ]] &&
8
+ return 0
9
+
10
+ bluer_agent pypi build
11
+ }
@@ -0,0 +1,4 @@
1
+ #! /usr/bin/env bash
2
+
3
+ alias @agent=bluer_agent
4
+ alias @ai_agent=bluer_agent
@@ -0,0 +1,11 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_agent() {
4
+ local task=$1
5
+
6
+ bluer_ai_generic_task \
7
+ plugin=bluer_agent,task=$task \
8
+ "${@:2}"
9
+ }
10
+
11
+ bluer_ai_log $(bluer_agent version --show_icon 1)
@@ -0,0 +1,40 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_agent_chat_validate() {
4
+ local options=$1
5
+ local do_upload=$(bluer_ai_option_int "$options" upload 0)
6
+ local verbose=$(bluer_ai_option_int "$options" verbose 1)
7
+
8
+ local object_name=$(bluer_ai_clarify_object $2 chat-$(bluer_ai_string_timestamp))
9
+ local chat_filename=$ABCLI_OBJECT_ROOT/$object_name/chat.json
10
+
11
+ # https://docs.arvancloud.ir/fa/aiaas/api-usage
12
+ bluer_ai_log "processing..."
13
+ curl --location "$BLUER_AGENT_CHAT_ENDPOINT/chat/completions" \
14
+ --header "Authorization: apikey $BLUER_AGENT_API_KEY" \
15
+ --header 'Content-Type: application/json' \
16
+ --data '{
17
+ "model": "DeepSeek-R1-Distill-Qwen-32b",
18
+ "messages": [
19
+ {"role": "user", "content": "چرا آسمان آبی است؟"}
20
+ ],
21
+ "max_tokens": 3000,
22
+ "temperature": 0.7
23
+ }' >$chat_filename
24
+ [[ $? -ne 0 ]] && return 1
25
+
26
+ [[ "$verbose" == 1 ]] &&
27
+ bluer_ai_cat $chat_filename
28
+
29
+ bluer_ai_eval - \
30
+ python3 -m bluer_algo.ai_agent.chat \
31
+ post_process \
32
+ --object_name $object_name
33
+ [[ $? -ne 0 ]] && return 1
34
+
35
+ [[ "$do_upload" == 1 ]] &&
36
+ bluer_objects_upload - \
37
+ $object_name
38
+
39
+ return 0
40
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_agent_chat() {
4
+ local task=$1
5
+
6
+ local function_name=bluer_agent_chat_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 -m bluer_algo.ai_agent "$@"
13
+ }
14
+
15
+ bluer_ai_source_caller_suffix_path /chat
@@ -0,0 +1,7 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_ai_install_bluer_agent() {
4
+ :
5
+ }
6
+
7
+ # bluer_ai_install_module bluer_agent 1.1.1
@@ -0,0 +1,8 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_bluer_agent_README() {
4
+ local options=$1
5
+
6
+ bluer_ai_eval ,$options \
7
+ bluer_agent build_README
8
+ }
@@ -0,0 +1,9 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_bluer_agent_chat() {
4
+ local options=$1
5
+
6
+ local object_name=test_bluer_agent_chat-$(bluer_ai_string_timestamp)
7
+
8
+ bluer_agent_chat_validate - $object_name
9
+ }
@@ -0,0 +1,36 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_bluer_agent_help() {
4
+ local options=$1
5
+
6
+ local module
7
+ for module in \
8
+ "@agent" \
9
+ "@agent chat" \
10
+ \
11
+ "@agent chat validate" \
12
+ "@agent transcription" \
13
+ "@agent transcription validate" \
14
+ \
15
+ "@agent pypi" \
16
+ "@agent pypi browse" \
17
+ "@agent pypi build" \
18
+ "@agent pypi install" \
19
+ \
20
+ "@agent pytest" \
21
+ \
22
+ "@agent test" \
23
+ "@agent test list" \
24
+ \
25
+ "@ai_agent" \
26
+ \
27
+ "bluer_agent"; do
28
+ bluer_ai_eval ,$options \
29
+ bluer_ai_help $module
30
+ [[ $? -ne 0 ]] && return 1
31
+
32
+ bluer_ai_hr
33
+ done
34
+
35
+ return 0
36
+ }
@@ -0,0 +1,17 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_bluer_agent_transcription() {
4
+ local options=$1
5
+
6
+ bluer_ai_eval ,$options \
7
+ bluer_agent_transcription_validate \
8
+ download,filename=farsi.wav,language=fa,verbose \
9
+ $BLUER_AGENT_TRANSCRIPTION_TEST_OBJECT
10
+ [[ $? -ne 0 ]] && return 1
11
+ bluer_ai_hr
12
+
13
+ bluer_ai_eval ,$options \
14
+ bluer_agent_transcription_validate \
15
+ download,filename=english.wav,language=env,verbose \
16
+ $BLUER_AGENT_TRANSCRIPTION_TEST_OBJECT
17
+ }
@@ -0,0 +1,8 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_bluer_agent_version() {
4
+ local options=$1
5
+
6
+ bluer_ai_eval ,$options \
7
+ "bluer_agent version ${@:2}"
8
+ }
@@ -0,0 +1,73 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_agent_transcription_validate() {
4
+ local options=$1
5
+ local do_download=$(bluer_ai_option_int "$options" download 1)
6
+ local do_install=$(bluer_ai_option_int "$options" install 0)
7
+ local do_record=$(bluer_ai_option_int "$options" record 0)
8
+ local do_play=$(bluer_ai_option_int "$options" play $do_record)
9
+ local do_upload=$(bluer_ai_option_int "$options" upload 0)
10
+ local language=$(bluer_ai_option "$options" language fa)
11
+ local filename=$(bluer_ai_option "$options" filename audio-$(bluer_ai_string_timestamp).wav)
12
+ local verbose=$(bluer_ai_option_int "$options" verbose 1)
13
+
14
+ if [[ "$do_install" == 1 ]]; then
15
+ brew install sox
16
+ fi
17
+
18
+ local object_name=$(bluer_ai_clarify_object $2 transcription-$(bluer_ai_string_timestamp))
19
+
20
+ [[ "$do_download" == 1 ]] &&
21
+ bluer_objects_download \
22
+ filename=$filename \
23
+ $object_name
24
+
25
+ local voice_filename=$ABCLI_OBJECT_ROOT/$object_name/$filename
26
+ local transcript_filename=$ABCLI_OBJECT_ROOT/$object_name/transcript.json
27
+
28
+ if [[ "$do_record" == 1 ]]; then
29
+ bluer_ai_log "recording audio ... (^C to end)"
30
+
31
+ bluer_ai_eval - \
32
+ rec \
33
+ -r 48000 \
34
+ -c 1 \
35
+ $voice_filename
36
+ [[ $? -ne 0 ]] && return 1
37
+ fi
38
+
39
+ if [[ ! -f "$voice_filename" ]]; then
40
+ bluer_ai_log_error "voice file not found: $voice_filename"
41
+ return 1
42
+ fi
43
+
44
+ if [[ "$do_play" == 1 ]]; then
45
+ bluer_ai_eval - \
46
+ afplay $voice_filename
47
+ [[ $? -ne 0 ]] && return 1
48
+ fi
49
+
50
+ [[ "$do_upload" == 1 ]] &&
51
+ bluer_objects_upload \
52
+ filename=$filename \
53
+ $object_name
54
+
55
+ # https://docs.arvancloud.ir/fa/aiaas/api-usage
56
+ bluer_ai_log "processing..."
57
+ curl --location "$BLUER_AGENT_TRANSCRIPTION_ENDPOINT/audio/transcriptions" \
58
+ --header "Authorization: apikey $BLUER_AGENT_API_KEY" \
59
+ --form "model=whisper-1" \
60
+ --form "file=@$voice_filename" \
61
+ --form "language=$language" >$transcript_filename
62
+ [[ $? -ne 0 ]] && return 1
63
+
64
+ [[ "$verbose" == 1 ]] &&
65
+ bluer_ai_cat $transcript_filename
66
+
67
+ bluer_ai_eval - \
68
+ python3 -m bluer_algo.ai_agent.transcription \
69
+ post_process \
70
+ --object_name $object_name \
71
+ --filename $voice_filename \
72
+ --language $language
73
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_agent_transcription() {
4
+ local task=$1
5
+
6
+ local function_name=bluer_agent_transcription_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 -m bluer_algo.ai_agent.transcription "$@"
13
+ }
14
+
15
+ bluer_ai_source_caller_suffix_path /transcription
@@ -0,0 +1,68 @@
1
+ import os
2
+
3
+ from bluer_options.help.functions import get_help
4
+ from bluer_objects import file, README
5
+
6
+ from bluer_agent import NAME, VERSION, ICON, REPO_NAME
7
+ from bluer_agent.help.functions import help_functions
8
+
9
+ items = README.Items(
10
+ [
11
+ {
12
+ "name": f"feature {index}",
13
+ "marquee": "https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true",
14
+ "description": f"description of feature {index} ...",
15
+ "url": "./bluer_agent/docs/feature_{}".format(
16
+ index if index == 1 else f"{index}.md"
17
+ ),
18
+ }
19
+ for index in range(1, 4)
20
+ ]
21
+ )
22
+
23
+
24
+ def build():
25
+ return all(
26
+ README.build(
27
+ items=readme.get("items", []),
28
+ path=os.path.join(file.path(__file__), readme["path"]),
29
+ ICON=ICON,
30
+ NAME=NAME,
31
+ VERSION=VERSION,
32
+ REPO_NAME=REPO_NAME,
33
+ help_function=lambda tokens: get_help(
34
+ tokens,
35
+ help_functions,
36
+ mono=True,
37
+ ),
38
+ )
39
+ for readme in [
40
+ {
41
+ "path": "..",
42
+ "items": items,
43
+ },
44
+ {
45
+ "path": "./docs",
46
+ },
47
+ # aliases
48
+ {
49
+ "path": "./docs/aliases",
50
+ },
51
+ {
52
+ "path": "./docs/aliases/agent.md",
53
+ },
54
+ # features
55
+ {
56
+ "path": "./docs/chat",
57
+ },
58
+ {
59
+ "path": "./docs/chat/validation.md",
60
+ },
61
+ {
62
+ "path": "./docs/transcription",
63
+ },
64
+ {
65
+ "path": "./docs/transcription/validation.md",
66
+ },
67
+ ]
68
+ )
@@ -0,0 +1,17 @@
1
+ NAME = "bluer_agent"
2
+
3
+ ICON = "👾"
4
+
5
+ DESCRIPTION = f"{ICON} an AI agent."
6
+
7
+ VERSION = "5.5.1"
8
+
9
+ REPO_NAME = "bluer-agent"
10
+
11
+ MARQUEE = "https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true"
12
+
13
+ ALIAS = "@agent"
14
+
15
+
16
+ def fullname() -> str:
17
+ return f"{NAME}-{VERSION}"
@@ -0,0 +1,17 @@
1
+ from blueness.argparse.generic import main
2
+
3
+ from bluer_agent import NAME, VERSION, DESCRIPTION, ICON, README
4
+ from bluer_agent.logger import logger
5
+
6
+ main(
7
+ ICON=ICON,
8
+ NAME=NAME,
9
+ DESCRIPTION=DESCRIPTION,
10
+ VERSION=VERSION,
11
+ main_filename=__file__,
12
+ tasks={
13
+ "build_README": lambda _: README.build(),
14
+ },
15
+ logger=logger,
16
+ )
17
+
@@ -0,0 +1,5 @@
1
+ BLUER_AGENT_MACHINE_USER_NAME=rangin-agent
2
+
3
+ BLUER_AGENT_TRANSCRIPTION_TEST_OBJECT=ai-agent-speech-to-text-2025-12-18-r5hbwu
4
+
5
+ BLUER_AGENT_CHAT_TEST_OBJECT=ai-agent-chat-2025-12-18-lc9vjd
@@ -0,0 +1,14 @@
1
+ from bluer_options.env import load_config, load_env, get_env
2
+
3
+ load_env(__name__)
4
+ load_config(__name__)
5
+
6
+ BLUER_AGENT_MACHINE_USER_NAME = get_env("BLUER_AGENT_MACHINE_USER_NAME")
7
+
8
+ BLUER_AGENT_API_KEY = get_env("BLUER_AGENT_API_KEY")
9
+
10
+ BLUER_AGENT_TRANSCRIPTION_ENDPOINT = get_env("BLUER_AGENT_TRANSCRIPTION_ENDPOINT")
11
+ BLUER_AGENT_TRANSCRIPTION_TEST_OBJECT = get_env("BLUER_AGENT_TRANSCRIPTION_TEST_OBJECT")
12
+
13
+ BLUER_AGENT_CHAT_ENDPOINT = get_env("BLUER_AGENT_CHAT_ENDPOINT")
14
+ BLUER_AGENT_CHAT_TEST_OBJECT = get_env("BLUER_AGENT_CHAT_TEST_OBJECT")
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,10 @@
1
+ from blueness import module
2
+ from bluer_options.help.functions import help_main
3
+
4
+ from bluer_agent import NAME
5
+ from bluer_agent.help.functions import help_functions
6
+
7
+ NAME = module.name(__file__, NAME)
8
+
9
+
10
+ help_main(NAME, help_functions)
@@ -0,0 +1,30 @@
1
+ from typing import List
2
+
3
+ from bluer_options.terminal import show_usage, xtra
4
+
5
+
6
+ def help_validate(
7
+ tokens: List[str],
8
+ mono: bool,
9
+ ) -> str:
10
+ options = xtra(
11
+ "upload,verbose",
12
+ mono=mono,
13
+ )
14
+
15
+ return show_usage(
16
+ [
17
+ "@agent",
18
+ "chat",
19
+ "validate",
20
+ f"[{options}]",
21
+ "[-|<object-name>]",
22
+ ],
23
+ "validate agent.",
24
+ mono=mono,
25
+ )
26
+
27
+
28
+ help_functions = {
29
+ "validate": help_validate,
30
+ }
@@ -0,0 +1,7 @@
1
+ from bluer_agent.help.chat import help_functions as help_chat
2
+ from bluer_agent.help.transcription import help_functions as help_transcription
3
+
4
+ help_functions = {
5
+ "chat": help_chat,
6
+ "transcription": help_transcription,
7
+ }
@@ -0,0 +1,49 @@
1
+ from typing import List
2
+
3
+ from bluer_options.terminal import show_usage, xtra
4
+
5
+
6
+ def help_validate(
7
+ tokens: List[str],
8
+ mono: bool,
9
+ ) -> str:
10
+ options = "".join(
11
+ [
12
+ xtra(
13
+ "download,",
14
+ mono=mono,
15
+ ),
16
+ "filename=<filename.wav>",
17
+ xtra(
18
+ ",install,",
19
+ mono=mono,
20
+ ),
21
+ "language=en|fa",
22
+ xtra(
23
+ ",~play,",
24
+ mono=mono,
25
+ ),
26
+ "record",
27
+ xtra(
28
+ ",upload,verbose",
29
+ mono=mono,
30
+ ),
31
+ ]
32
+ )
33
+
34
+ return show_usage(
35
+ [
36
+ "@agent",
37
+ "transcription",
38
+ "validate",
39
+ f"[{options}]",
40
+ "[-|<object-name>]",
41
+ ],
42
+ "validate agent.",
43
+ mono=mono,
44
+ )
45
+
46
+
47
+ help_functions = {
48
+ "validate": help_validate,
49
+ }
@@ -0,0 +1,11 @@
1
+ from typing import List
2
+
3
+ from bluer_ai.host import signature as bluer_ai_signature
4
+
5
+ from bluer_agent import fullname
6
+
7
+
8
+ def signature() -> List[str]:
9
+ return [
10
+ fullname(),
11
+ ] + bluer_ai_signature()
@@ -0,0 +1,4 @@
1
+ from bluer_options.logger import get_logger
2
+ from bluer_agent import ICON
3
+
4
+ logger = get_logger(ICON)
@@ -0,0 +1,4 @@
1
+ BLUER_AGENT_API_KEY=void
2
+
3
+ BLUER_AGENT_TRANSCRIPTION_ENDPOINT=https://void
4
+ BLUER_AGENT_CHAT_ENDPOINT=https://void
@@ -0,0 +1,2 @@
1
+ urlpatterns = []
2
+
@@ -0,0 +1,53 @@
1
+ Metadata-Version: 2.4
2
+ Name: bluer_agent
3
+ Version: 5.5.1
4
+ Summary: 👾 an AI agent.
5
+ Home-page: https://github.com/kamangir/bluer-agent
6
+ Author: Arash Abadpour (Kamangir)
7
+ Author-email: arash.abadpour@gmail.com
8
+ License: CC0-1.0
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Unix Shell
11
+ Classifier: Operating System :: OS Independent
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: bluer_ai
15
+ Dynamic: author
16
+ Dynamic: author-email
17
+ Dynamic: classifier
18
+ Dynamic: description
19
+ Dynamic: description-content-type
20
+ Dynamic: home-page
21
+ Dynamic: license
22
+ Dynamic: license-file
23
+ Dynamic: requires-dist
24
+ Dynamic: summary
25
+
26
+ # 👾 bluer-agent
27
+
28
+ 👾 `@agent` is a set of tools for interacting with LLMs.
29
+
30
+ ## installation
31
+
32
+ ```bash
33
+ pip install bluer-agent
34
+ ```
35
+
36
+ ## features
37
+
38
+ | | | |
39
+ | --- | --- | --- |
40
+ | [`feature 1`](https://github.com/kamangir/bluer-agent/blob/main/bluer_agent/docs/feature_1) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](https://github.com/kamangir/bluer-agent/blob/main/bluer_agent/docs/feature_1) description of feature 1 ... | [`feature 2`](https://github.com/kamangir/bluer-agent/blob/main/bluer_agent/docs/feature_2.md) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](https://github.com/kamangir/bluer-agent/blob/main/bluer_agent/docs/feature_2.md) description of feature 2 ... | [`feature 3`](https://github.com/kamangir/bluer-agent/blob/main/bluer_agent/docs/feature_3.md) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](https://github.com/kamangir/bluer-agent/blob/main/bluer_agent/docs/feature_3.md) description of feature 3 ... |
41
+
42
+ # aliases
43
+
44
+ [@agent](https://github.com/kamangir/bluer-agent/blob/main/bluer_agent/docs/aliases/agent.md).
45
+
46
+ ---
47
+
48
+
49
+ [![pylint](https://github.com/kamangir/bluer-agent/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/bluer-agent/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/bluer-agent/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/bluer-agent/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/bluer-agent/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/bluer-agent/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/bluer-agent.svg)](https://pypi.org/project/bluer-agent/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/bluer-agent)](https://pypistats.org/packages/bluer-agent)
50
+
51
+ built by 🌀 [`bluer README`](https://github.com/kamangir/bluer-objects/tree/main/bluer_objects/README), based on 👾 [`bluer_agent-5.5.1`](https://github.com/kamangir/bluer-agent).
52
+
53
+ built by 🌀 [`blueness-3.118.1`](https://github.com/kamangir/blueness).
@@ -0,0 +1,40 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ requirements.txt
6
+ setup.py
7
+ bluer_agent/README.py
8
+ bluer_agent/__init__.py
9
+ bluer_agent/__main__.py
10
+ bluer_agent/config.env
11
+ bluer_agent/env.py
12
+ bluer_agent/functions.py
13
+ bluer_agent/host.py
14
+ bluer_agent/logger.py
15
+ bluer_agent/sample.env
16
+ bluer_agent/urls.py
17
+ bluer_agent.egg-info/PKG-INFO
18
+ bluer_agent.egg-info/SOURCES.txt
19
+ bluer_agent.egg-info/dependency_links.txt
20
+ bluer_agent.egg-info/requires.txt
21
+ bluer_agent.egg-info/top_level.txt
22
+ bluer_agent/.abcli/abcli.sh
23
+ bluer_agent/.abcli/actions.sh
24
+ bluer_agent/.abcli/alias.sh
25
+ bluer_agent/.abcli/bluer_agent.sh
26
+ bluer_agent/.abcli/chat.sh
27
+ bluer_agent/.abcli/install.sh
28
+ bluer_agent/.abcli/transcription.sh
29
+ bluer_agent/.abcli/chat/validate.sh
30
+ bluer_agent/.abcli/tests/README.sh
31
+ bluer_agent/.abcli/tests/chat.sh
32
+ bluer_agent/.abcli/tests/help.sh
33
+ bluer_agent/.abcli/tests/transcription.sh
34
+ bluer_agent/.abcli/tests/version.sh
35
+ bluer_agent/.abcli/transcription/validate.sh
36
+ bluer_agent/help/__init__.py
37
+ bluer_agent/help/__main__.py
38
+ bluer_agent/help/chat.py
39
+ bluer_agent/help/functions.py
40
+ bluer_agent/help/transcription.py
@@ -0,0 +1 @@
1
+ bluer_ai
@@ -0,0 +1 @@
1
+ bluer_agent
@@ -0,0 +1,6 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools>=42",
4
+ "wheel",
5
+ "blueness",
6
+ ]
@@ -0,0 +1 @@
1
+ bluer_ai
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,23 @@
1
+ from blueness.pypi import setup
2
+
3
+ from bluer_agent import NAME, VERSION, DESCRIPTION, REPO_NAME
4
+
5
+ setup(
6
+ filename=__file__,
7
+ repo_name=REPO_NAME,
8
+ name=NAME,
9
+ version=VERSION,
10
+ description=DESCRIPTION,
11
+ packages=[
12
+ NAME,
13
+ f"{NAME}.help",
14
+ ],
15
+ include_package_data=True,
16
+ package_data={
17
+ NAME: [
18
+ "config.env",
19
+ "sample.env",
20
+ ".abcli/**/*.sh",
21
+ ],
22
+ },
23
+ )