Skip to content

new complete with options not returning meta data #151

@ChuliangXiao

Description

@ChuliangXiao
#  `snowflake-ml-python=1.8.1`
model = 'llama3.2-3b'
#options = cortex.CompleteOptions(top_p=0, temperature=0)
resp = cortex.complete(model, 'tell me a joke', options={})
print(resp)


options = cortex.CompleteOptions(guardrails=True)
resp = cortex.complete(model, 'tell me a joke', options=options)
print(resp)

Both return a string without meta data (usage, created, model).

While cortex.Complete with options argument in the old version snowflake-ml-python=1.6.0 returns a JSON string with meta data.

Activity

changed the title [-]new complete with optiona not returning meta data[/-] [+]SNOW-2040843: new complete with optiona not returning meta data[/+] on Apr 14, 2025
changed the title [-]SNOW-2040843: new complete with optiona not returning meta data[/-] [+]new complete with options not returning meta data[/+] on Apr 14, 2025
sfc-gh-bprosnitz

sfc-gh-bprosnitz commented on Apr 23, 2025

@sfc-gh-bprosnitz

Thanks for reaching out about this. There is an alternate API which can provide the metadata: https://docs.snowflake.com/en/developer-guide/snowflake-python-api/reference/latest/_autosummary/snowflake.core.cortex.inference_service.CortexInferenceService

Does this help for your use case?

ChuliangXiao

ChuliangXiao commented on Apr 23, 2025

@ChuliangXiao
Author

@sfc-gh-bprosnitz can you provide a code snippet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ChuliangXiao@sfc-gh-bprosnitz

        Issue actions

          new complete with options not returning meta data · Issue #151 · snowflakedb/snowflake-ml-python