Skip to content

Commit

Permalink
feat(interface/chat_functions): expose data via redis
Browse files Browse the repository at this point in the history
for reduced load
  • Loading branch information
stakach committed Oct 18, 2023
1 parent 9e99e2f commit 3f310b1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: placeos-driver
version: 6.9.9
version: 6.9.10
crystal: ">= 1.0.0"

dependencies:
Expand Down
16 changes: 16 additions & 0 deletions src/placeos-driver/interface/chat_functions.cr
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ abstract class PlaceOS::Driver
{% end %}
}
end

def on_load
{% if @type.methods.find { |meth| meth.name.id.stringify == "on_load" } %}
previous_def
{% end %}
self[:capabilities] = capabilities
self[:function_schemas] = function_schemas
end

def on_update
{% if @type.methods.find { |meth| meth.name.id.stringify == "on_update" } %}
previous_def
{% end %}
self[:capabilities] = capabilities
self[:function_schemas] = function_schemas
end
end

macro included
Expand Down

0 comments on commit 3f310b1

Please sign in to comment.