Skip to content

Commit

Permalink
fix: formatting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
snorreks committed Jan 16, 2025
1 parent e0b948e commit 037f4fb
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 13 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/discord-notifications.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Discord Notifications

on:
push:
branches:
- '**' # Notify for all branches
pull_request:
branches:
- '**' # Notify for all PRs
workflow_run:
workflows: ['Generic CI', 'Godot CI', 'Build, Release and Deploy']
types:
- completed

jobs:
notify-on-push:
name: Notify on Push
runs-on: ubuntu-latest
steps:
- name: Notify Discord about Commit
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
embed-title: '🚀 New Commit Pushed!'
embed-description: |
**Commit Message:** ${{ github.event.head_commit.message }}
**Branch:** ${{ github.ref_name }}
**Author:** ${{ github.actor }}
[View Commit](${{ github.event.head_commit.url }})
embed-color: 3066993 # Blue

notify-on-completion:
name: Notify on Workflow Completion
runs-on: ubuntu-latest
if: ${{ always() }} # Runs whether the workflow succeeds or fails
steps:
- name: Notify Discord about Workflow Status
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
embed-title: 'Status: ${{ job.status }} for ${{ github.workflow }}'
embed-description: |
**Repository:** ${{ github.repository }}
**Branch:** ${{ github.ref_name }}
**Triggered by:** ${{ github.actor }}
embed-color: ${{ job.status == 'success' && 3066993 || 15158332 }} # Green for success, Red for failure

notify-on-failure:
name: Notify on Failure
runs-on: ubuntu-latest
if: ${{ failure() }}
steps:
- name: Notify Discord about Failure
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
embed-title: '🚨 Workflow Failed!'
embed-description: |
**Workflow:** ${{ github.workflow }}
**Branch:** ${{ github.ref_name }}
**Failed Job:** ${{ github.job }}
**Triggered by:** ${{ github.actor }}
embed-color: 15158332 # Red
8 changes: 4 additions & 4 deletions game/core/api/speech_to_text/hf_stt.gd
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ func _handle_stream_chunk(chunk: PackedByteArray) -> void:
response = response.strip_edges() # Remove leading and trailing whitespaces, including new lines
var data_entries := response.split("\n\n") # Split the body into individual data entries
for entry in data_entries:
if !handle_chunk_entry(entry.replace("data: ", "")):
if !_handle_chunk_entry(entry.replace("data: ", "")):
return


func handle_chunk_entry(entry: String) -> bool:
Logger.debug("handle_chunk_entry:entry", entry)
func _handle_chunk_entry(entry: String) -> bool:
Logger.debug("_handle_chunk_entry:entry", entry)
if entry == "[DONE]":
Logger.debug("handle_chunk_entry:stream_result", _stream_text)
Logger.debug("_handle_chunk_entry:stream_result", _stream_text)
_http_stream_client.finish_request()
SignalManager.speech_to_text_chunk_added.emit("")
return false
Expand Down
8 changes: 4 additions & 4 deletions game/core/api/text/ollama.gd
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ func _handle_stream_chunk(chunk: PackedByteArray) -> void:
response = response.strip_edges() # Remove leading and trailing whitespaces, including new lines
var data_entries := response.split("\n\n") # Split the body into individual data entries
for entry in data_entries:
if !handle_chunk_entry(entry.replace("data: ", "")):
if !_handle_chunk_entry(entry.replace("data: ", "")):
return


func handle_chunk_entry(entry: String) -> bool:
Logger.debug("handle_chunk_entry:entry", entry)
func _handle_chunk_entry(entry: String) -> bool:
Logger.debug("_handle_chunk_entry:entry", entry)
if entry == "[DONE]":
Logger.debug("handle_chunk_entry:stream_result", _stream_text)
Logger.debug("_handle_chunk_entry:stream_result", _stream_text)
_http_stream_client.finish_request()
SignalManager.text_chunk_added.emit("")
return false
Expand Down
8 changes: 4 additions & 4 deletions game/core/api/text/open_ai.gd
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,14 @@ func _handle_stream_chunk(chunk: PackedByteArray) -> void:
response = response.strip_edges() # Remove leading and trailing whitespaces, including new lines
var data_entries := response.split("\n\n") # Split the body into individual data entries
for entry in data_entries:
if !handle_chunk_entry(entry.replace("data: ", "")):
if !_handle_chunk_entry(entry.replace("data: ", "")):
return


func handle_chunk_entry(entry: String) -> bool:
Logger.debug("handle_chunk_entry:entry", entry)
func _handle_chunk_entry(entry: String) -> bool:
Logger.debug("_handle_chunk_entry:entry", entry)
if entry == "[DONE]":
Logger.debug("handle_chunk_entry:stream_result", _stream_text)
Logger.debug("_handle_chunk_entry:stream_result", _stream_text)
_http_stream_client.finish_request()
SignalManager.text_chunk_added.emit("")
return false
Expand Down
1 change: 0 additions & 1 deletion game/interface/inventory/control/inventory_control_grid.gd
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ var inventory: InventoryGrid:
var _inventory_control_item_container: Control
var _inventory_control_drop_zone: DropZone
var _selected_item: InterfaceInventoryItem

var _field_background_grid: Control
var _field_backgrounds: Array
var _selection_panel: Panel
Expand Down

0 comments on commit 037f4fb

Please sign in to comment.