Replies: 1 comment 33 replies
-
To get information about the tokens used by a VertexAI Model, you can refer to the following parameters in the VertexAI Component:
These parameters help control and manage the token usage in the VertexAI model. {
"max_output_tokens": 128,
"top_k": 40,
"top_p": 0.95
} Additionally, you can adjust other parameters such as In the class ChatVertexAIComponent(LCModelComponent):
display_name = "Vertex AI"
description = "Generate text using Vertex AI LLMs."
icon = "VertexAI"
field_order = [
"credentials",
"project",
"examples",
"location",
"max_output_tokens",
"model_name",
"temperature",
"top_k",
"top_p",
"verbose",
"input_value",
"system_message",
"stream",
]
def build_config(self):
return {
"credentials": {
"display_name": "Credentials",
"field_type": "file",
"file_types": [".json"],
"file_path": None,
},
"examples": {
"display_name": "Examples",
"multiline": True,
},
"location": {
"display_name": "Location",
"value": "us-central1",
},
"max_output_tokens": {
"display_name": "Max Output Tokens",
"value": 128,
"advanced": True,
},
"model_name": {
"display_name": "Model Name",
"value": "chat-bison",
},
"project": {
"display_name": "Project",
},
"temperature": {
"display_name": "Temperature",
"value": 0.0,
},
"top_k": {
"display_name": "Top K",
"value": 40,
"advanced": True,
},
"top_p": {
"display_name": "Top P",
"value": 0.95,
"advanced": True,
},
"verbose": {
"display_name": "Verbose",
"value": False,
"advanced": True,
},
"input_value": {"display_name": "Input"},
"stream": {
"display_name": "Stream",
"info": STREAM_INFO_TEXT,
"advanced": True,
},
"system_message": {
"display_name": "System Message",
"info": "System message to pass to the model.",
"advanced": True,
},
} This configuration allows you to customize the token usage and other parameters for the VertexAI model [1][2][3]. |
Beta Was this translation helpful? Give feedback.
33 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
How to get information about used tokens by Model?
I think I saw it was possible in the past, but is it still?
Thanks!
a.
Beta Was this translation helpful? Give feedback.
All reactions