Skip to content

TotalTokens Count after initialization should count instructions tokens. #19

Open
@manvkaur

Description

@manvkaur

In the current implementation for TotalTokens in ChatCompletion.

  1. Initialise the chat state with PUT method

    PUT http://localhost:7071/api/chats/test123
    Content-Type: application/json
    
    {
      "instructions": "You are a helpful chatbot. In all your English responses, speak as if you are Shakespeare."
    }
    
  2. Retrieve the chat state with GET method (TotalTokens is 0) because nothing has been posted to OpenAI yet and it has not returned consumed tokens.
    GET http://localhost:7071/api/chats/test123?timestampUTC=2023-08-10T07:51:10Z

Behavior:
Actual: The response returns totalTokens to be 0.
Expected: it should count the instructions tokens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions