Skip to content

Commit

Permalink
prepare to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineJac committed Jun 20, 2024
1 parent 763cb6a commit ff63000
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
17 changes: 4 additions & 13 deletions kong/plugins/prometheus/exporter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -331,19 +331,10 @@ local function log(message, serialized)

if serialized.ai_metrics then
for _, ai_plugin in pairs(serialized.ai_metrics) do
local cache_status
if ai_plugin.cache and ai_plugin.cache.cache_status then
cache_status = ai_plugin.cache.cache_status
end

local vector_db, embeddings_provider, embeddings_model
if ai_plugin.cache then
vector_db = ai_plugin.cache.vector_db

embeddings_provider = ai_plugin.cache.embeddings_provider

embeddings_model = ai_plugin.cache.embeddings_model
end
local cache_status = ai_plugin.cache.cache_status or ""
local vector_db = ai_plugin.cache.vector_db or ""
local embeddings_provider = ai_plugin.cache.embeddings_provider or ""
local embeddings_model = ai_plugin.cache.embeddings_model or ""

labels_table_ai_llm_status[1] = ai_plugin.meta.provider_name
labels_table_ai_llm_status[2] = ai_plugin.meta.request_model
Expand Down
4 changes: 2 additions & 2 deletions spec/03-plugins/38-ai-proxy/02-openai_integration_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ local _EXPECTED_CHAT_STATS = {
response_model = 'gpt-3.5-turbo-0613',
},
usage = {
completion_tokens = 12,
cost = 0.00037,
prompt_tokens = 25,
completion_tokens = 12,
total_tokens = 37,
cost = 0.00037,
},
cache = {}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ local _EXPECTED_CHAT_STATS = {
response_model = 'gpt-3.5-turbo-0613',
},
usage = {
completion_tokens = 12,
cost = 0.00037,
prompt_tokens = 25,
completion_tokens = 12,
total_tokens = 37,
cost = 0.00037,
},
cache = {}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ local _EXPECTED_CHAT_STATS = {
response_model = 'gpt-3.5-turbo-0613',
},
usage = {
completion_tokens = 12,
cost = 0.00037,
prompt_tokens = 25,
completion_tokens = 12,
total_tokens = 37,
cost = 0.00037,
},
cache = {}
},
Expand Down

0 comments on commit ff63000

Please sign in to comment.