Actions3
- Изображение Actions
- Токены Actions
Токены → Посчитать токены
AI-generatedOverview
This node interacts with the GigaChat API to count tokens in a given message. It is useful for scenarios where you need to monitor or manage token usage in text inputs, such as optimizing prompts for language models or tracking token consumption in chat applications.
Use Case Examples
- Counting tokens in a user prompt before sending it to a language model to ensure it fits within token limits.
- Analyzing token usage in messages to manage API costs or quotas.
Properties
| Name | Meaning |
|---|---|
| Model | Select the GigaChat model to be used for token counting. |
| Промпт | The text prompt for which tokens will be counted. This is a required input. |
Output
JSON
tokenCount- The number of tokens counted in the provided prompt.modelId- The identifier of the GigaChat model used for counting tokens.
Dependencies
- Requires GigaChat API credentials for authentication.
Troubleshooting
- Ensure the GigaChat API credentials are correctly configured and valid to avoid authentication errors.
- Verify that the prompt text is provided and not empty, as it is required for token counting.
- If token counting fails, check network connectivity and API endpoint availability.
Links
- GigaChat Node Disclaimers - Important disclaimers and usage notes for the unofficial GigaChat node.