opendatahub-io / caikit-nlp-client

A grpc and http client library for caikit-nlp
Apache License 2.0
3 stars 6 forks source link

grpc client: add method to list generate_text parameters #61

Closed dtrifiro closed 12 months ago

dtrifiro commented 12 months ago
desc_pool = DescriptorPool(reflection_db)
nlp_service = desc_pool.FindServiceByName('caikit.runtime.Nlp.NlpService')
print('Available methods:')
for m in nlp_service.methods:
    print(m.name)

method_desc = nlp_service.FindMethodByName('TextGenerationTaskPredict')
for field in method_desc.input_type.fields:
    print(f'{field.name}, {field.type}, default: {field.default_value}')