Skip to content

Optionally return additional information in pythonic models #809

@zeiler

Description

@zeiler

When calling a pythonic model that is a sublcass of ModelClass we allow using the model_client.py code to call the function directly. So if the subclass of ModelClass has a method predict(prompt, reasoning_effort) then the client side can do:

rom clarifai.client import Model

model = Model(
  url = "https://clarifai.com/user/app/models/my-model",
  pat = "*****",
  deployment_id = "my-deploy",
)
response = model.predict(
    prompt = "What is the future of AI?", 
    reasoning_effort = "medium"
)
print(response)

We would like to allow any of those methods to accept an additional parameter like with_proto=True/False that would change the client side function call to return two pieces of information: 1) the current response as it does today and 2) additional details we have from the underlying protobuf by returning the underlying proto that the API returns.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions