Replies: 2 comments 4 replies
-
Also I know using page format and body-format parameters I can narrow down but then the length of the function becomes invalid. Kindly help with the same, thanks in advance. |
Beta Was this translation helpful? Give feedback.
0 replies
-
When using agents, multiple completions calls are made, and function definitions must be passed every time for the agent to intelligently delegate when/if tools should be used, that is the reason for high usage and multiple token transactions. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What is your question?
Hello, I had created an agent using Azure OpenAI , gpt-40-mini model. So, I am running my action using the following configuration -
openapi: 3.0.1
info:
title: Jira Issue API
description: API to retrieve Jira issue details
version: 1.0.0
servers:
paths:
/issue/OS-663:
get:
summary: Get issue details
description: Retrieve the details of a Jira issue by issue ID or key.
parameters:
- name: issueIdOrKey
in: path
required: true
description: The ID or key of the issue.
schema:
type: string
security:
- basicAuth: []
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
expand:
type: string
id:
type: string
self:
type: string
format: uri
key:
type: string
fields:
type: object
properties:
# Example customization based on fields shown
customfield_10556:
type: object
properties:
cmdb:
type: object
properties:
label:
type: string
objectKey:
type: string
customfield_10774:
type: object
properties:
cmdb:
type: object
properties:
label:
type: string
objectKey:
type: string
# Add more fields as needed
'401':
description: Unauthorized
'404':
description: Issue not found
components:
securitySchemes:
basicAuth:
type: http
scheme: basic
So, in a fresh session , I ask the agent - get me issue details then the backend logs state-
2025-02-10T12:33:00.367725376Z {"completionTokens":29,"level":"debug","message":"[spendTokens] conversationId: a0efe278-220c-4b4d-a71f-0912a7cf84bf | Context: message | Token usage: ","promptTokens":58,"timestamp":"2025-02-10T12:33:00.367Z"}
2025-02-10T12:33:00.368683850Z {"completionTokens":345,"level":"debug","message":"[spendTokens] conversationId: a0efe278-220c-4b4d-a71f-0912a7cf84bf | Context: message | Token usage: ","promptTokens":24877,"timestamp":"2025-02-10T12:33:00.368Z"}
I cannot understand why two times the token usage is being shown.
Then when in the same chat session, I query for example- who is the reporter then it shows this-
2025-02-10T12:36:01.263283289Z {"completionTokens":51,"level":"debug","message":"[spendTokens] conversationId: a0efe278-220c-4b4d-a71f-0912a7cf84bf | Context: message | Token usage: ","promptTokens":25234,"timestamp":"2025-02-10T12:36:01.261Z"}
So, the questions are
Can it be optimised as I cannot spend these many token in a single session for a single user.
More Details
Steps to reproduce -
Create an agent with any endpoint
Add an action
Query using first prompt
Then check the logs, two usages are shown
And of high token value.
What is the main subject of your question?
Other
Screenshots
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions