Skip to content

Commit

Permalink
New Experimental Training Features, Providers Refactor (#1155)
Browse files Browse the repository at this point in the history
* Lean AGiXT

* Leannnnnnnn

* Add defaults

* Add to default embedder

* Remove requirement

* Clean up

* Add provider services

* Add service endpoint

* Add services to agent

* Add to defaults

* Add provider settings

* Fix bad refs

* Add services test

* Switch model to gpt-4-vision-preview if images uploaded

* Remove old refs

* Add image generations endpoint

* QA Improvements for DPO training

* Update dataset creation to use DPO method

* Remove embeddings, clean up

* Move functionality

* Add np

* Attempt to fix embedder

* Remove old voice code

* Maybe fix embedder

* Use input instead of text

* Tuning wip

* Add fine_tune_llm function

* Attempt at fixing embedders

* Use memories directly

* Add auto installs

* Clean up

* Clean up

* Added huggingface api key from agent settings

* Update embedding provider

* Use messages style for good/bad answers

* Add .embeddings

* Add static methods for services

* Lint

* Add training status

* Remove text

* Fix ref

* this seems crazy

* Improve training endpoint

* v1.5.0

* Increase sleep on test

* Fix api_base ref

* Clean up provider docs

* Fix warning about model_name

* Update agixtsdk to 0.0.34

* Update requirements

* Add claude vision

* Add system message

* Clean up readme

* Improve dev compose

* Add dev pg

* Remove code causing error

* Updates

* Handle provider setting update

* Fix get_agents

* Add status for user agents

* Modify get_agents

* Fix duplicates in agent list

* Remove condition causing issue

* Add tests, fix endpoints

* Improve tests

* Fix translate_audio response

* Fix transcribe audio

* Add completions tests to tests on main

* Trnascription fix attempt

* Convert audio

* Fix endpoints

* work?

* Switch x-wav to wav

* Updates

* Use file extension

* Use wav

* Use full path

* Always segment

* Add dot

* fix tts return

* Fix tts response

* add decoder

* STT Fix attempt

* Use ffmpeg

* Fix test

* Clean up

* wOrKs oN mY mAcHiNe

* Add providers to example

* use if not

* use agent_name

* Use if not user

* Add user to collection name

* get default user global

* Updates

* change file type

* pass thru urls

* Updates

* Clean up ezlocalai response

* improve vision

* change output location for file in test

* Try using gtts as default?

* Use audiosegment

* Fix google provider

* Fix api key for google provider

* continue

* Fix defaults

* Add mode

* Hope this works!

* Fix tabbing

* Remove unused refs
  • Loading branch information
Josh-XT authored Apr 2, 2024
1 parent a16b197 commit 409909b
Show file tree
Hide file tree
Showing 68 changed files with 1,912 additions and 3,264 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/publish-docker-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,13 @@ jobs:
report-name: "agixt-db-tests"
additional-python-dependencies: agixtsdk
needs: build-agixt

test-completions:
uses: josh-xt/AGiXT/.github/workflows/operation-test-with-jupyter.yml@main
with:
notebook: tests/completions-tests.ipynb
image: ghcr.io/${{ needs.build-agixt.outputs.github_user }}/${{ needs.build-agixt.outputs.repo_name }}:${{ github.sha }}
port: "7437"
db-connected: false
report-name: "completions-tests"
additional-python-dependencies: openai requests python-dotenv
needs: build-agixt
11 changes: 10 additions & 1 deletion .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,13 @@ jobs:
report-name: "agixt-db-tests"
additional-python-dependencies: agixtsdk
needs: build-agixt

test-completions:
uses: josh-xt/AGiXT/.github/workflows/operation-test-with-jupyter.yml@main
with:
notebook: tests/completions-tests.ipynb
image: ${{ needs.build-agixt.outputs.primary-image }}
port: "7437"
db-connected: false
report-name: "completions-tests"
additional-python-dependencies: openai requests python-dotenv
needs: build-agixt
78 changes: 0 additions & 78 deletions agixt/AudioToText.py

This file was deleted.

13 changes: 10 additions & 3 deletions agixt/Defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,23 @@

DEFAULT_SETTINGS = {
"provider": "gpt4free",
"embedder": "default",
"AI_MODEL": "gpt-3.5-turbo",
"mode": "prompt",
"prompt_category": "Default",
"prompt_name": "Chat",
"embeddings_provider": "default",
"tts_provider": "default",
"transcription_provider": "default",
"translation_provider": "default",
"image_provider": "default",
"VOICE": "Brian",
"AI_MODEL": "mixtral-8x7b",
"AI_TEMPERATURE": "0.7",
"AI_TOP_P": "1",
"MAX_TOKENS": "4096",
"helper_agent_name": "gpt4free",
"WEBSEARCH_TIMEOUT": 0,
"WAIT_BETWEEN_REQUESTS": 1,
"WAIT_AFTER_FAILURE": 3,
"stream": False,
"WORKING_DIRECTORY": "./WORKSPACE",
"WORKING_DIRECTORY_RESTRICTED": True,
"AUTONOMOUS_EXECUTION": True,
Expand Down
59 changes: 0 additions & 59 deletions agixt/Embedding.py

This file was deleted.

19 changes: 0 additions & 19 deletions agixt/Extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,25 +145,6 @@ def get_commands_list(self):
return commands_list

async def execute_command(self, command_name: str, command_args: dict = None):
if command_args:
if "is_m4a_audio" in command_args or "is_wav_audio" in command_args:
new_command_args = {}
for arg in command_args:
if "is_m4a_audio" in command_args:
if arg == command_args["is_m4a_audio"]:
new_command_args[arg] = await self.execute_command(
command_name="Transcribe M4A Audio",
command_args={"base64_audio": command_args[arg]},
)
if "is_wav_audio" in command_args:
if arg == command_args["is_wav_audio"]:
new_command_args[arg] = await self.execute_command(
command_name="Transcribe WAV Audio",
command_args={"base64_audio": command_args[arg]},
)
if arg not in new_command_args:
new_command_args[arg] = command_args[arg]
command_args = new_command_args
injection_variables = {
"user": self.user,
"agent_name": self.agent_name,
Expand Down
18 changes: 0 additions & 18 deletions agixt/Interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,27 +409,9 @@ async def run(
browse_links: bool = False,
prompt_category: str = "Default",
persist_context_in_history: bool = False,
is_m4a_audio: bool = False,
is_wav_audio: bool = False,
images: list = [],
**kwargs,
):
if is_m4a_audio or is_wav_audio:
# Convert the audio to text
ext = Extensions(
agent_name=self.agent_name,
agent_config=self.agent.AGENT_CONFIG,
conversation_name=conversation_name,
ApiClient=self.ApiClient,
user=self.user,
)
command_output = await ext.execute_command(
command_name=(
"Transcribe M4A Audio" if is_m4a_audio else "Transcribe WAV Audio"
),
command_args={"base64_audio": user_input},
)
user_input = command_output
shots = int(shots)
if "prompt_category" in kwargs:
prompt_category = kwargs["prompt_category"]
Expand Down
Loading

0 comments on commit 409909b

Please sign in to comment.