Closed xiaohai-78 closed 4 months ago
To resolve the validation errors related to the 'tokens' and 'total_tokens' fields when adding the Doubao TEXT Embedding model in Dify version 0.6.8, you need to ensure that these fields are included in the model configuration.
Here is the updated configuration:
ModelConfigs = {
'Doubao-embedding': {
'req_params': {},
'model_properties': {
'context_size': 4096,
'max_chunks': 1,
'tokens': 0, # Add this line
'total_tokens': 0, # Add this line
}
},
}
By adding 'tokens': 0
and 'total_tokens': 0
to the model_properties
, you should be able to resolve the validation errors. If you continue to experience issues, ensure that all environment variable settings and Docker network configurations are correctly applied. Also, check for any firewall rules or network policies that might be blocking the connection between Dify and the Doubao service.
To continue the conversation, mention @dosu.
@sinomoe pls help to check this issue
it has fixed by below pr : https://github.com/langgenius/dify/pull/4431
it has fixed by below pr : #4431它已修复以下 PR : #4431
When will this bug go online?
Self Checks
Dify version
0.6.8
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
code : "invalid_param" message : "2 validation errors for EmbeddingUsage\ntokens\n none is not an allowed value (type=type_error.none.not_allowed)\ntotal_tokens\n none is not an allowed value (type=type_error.none.not_allowed)" status : 400
✔️ Expected Behavior
The Doubao TEXT Embedding model can be added normally
❌ Actual Behavior
No response