Skip to content

add llm_gateway_generate_text#83

Merged
jcatt-sf merged 4 commits intomainfrom
add-llm_gateway_generate_text
Apr 6, 2026
Merged

add llm_gateway_generate_text#83
jcatt-sf merged 4 commits intomainfrom
add-llm_gateway_generate_text

Conversation

@jcatt-sf
Copy link
Copy Markdown
Collaborator

@jcatt-sf jcatt-sf commented Apr 3, 2026

No description provided.

@salesforce-cla
Copy link
Copy Markdown

salesforce-cla bot commented Apr 3, 2026

Thanks for the contribution! It looks like @jcatt-sf is an internal user so signing the CLA is not required. However, we need to confirm this.

CHANGELOG.md Outdated

- **`llm_gateway_generate_text()` UDF wrapper for AI-powered DataFrame transformations.**

New method on proxy providers to generate AI completions in DataFrame operations via the `llm_gateway_generate` UDF.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this and the two other mentions of the UDF, can we remove the llm_gateway_generate name of the built-in UDF? I think it makes sense to document the implementation of this being a built-in UDF, so that users can understand its usage. But the name of it might change over time, and is opaque/hidden from the user of the SDK. My proposal would be via a built-in UDF for the end of this sentence, and similar for other mentions of the UDF name?

CHANGELOG.md Outdated
- `template` (str): Prompt template with {placeholder} syntax
- `values` (dict or Column): Dict mapping placeholders to Columns, or pre-built named_struct
- `llmModelId` (str): Model identifier (required, e.g., "sfdc_ai__DefaultGPT4Omni")
- `maxTokens` (int): Maximum response length (required, e.g., 200)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is correct- my understanding would be that maxTokens is actually providing a ceiling for how many LLM tokens can be used, instead of a max response text length. Might want to double-check LLM Gateway docs.

### LLM Gateway

> [!WARNING]
> Currently we only support reading from DMOs and writing to DMOs or reading from DLOs and writing to DLOs, but they cannot mix.
Copy link
Copy Markdown
Contributor

@markdlv-sf markdlv-sf Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this warning? I think it should stay in the section above this one.

README.md Outdated
```

> [!WARNING]
> This method returns a placeholder string in local development and won't execute. It only works when deployed, where it calls the real LLM Gateway service via the `llm_gateway_generate` UDF.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: could we remove "and won't execute" from this sentence? It almost sounds like it won't work locally at all, but really it (should) return a placeholder response string successfully.

@jcatt-sf jcatt-sf merged commit a1baec6 into main Apr 6, 2026
2 checks passed
@jcatt-sf jcatt-sf deleted the add-llm_gateway_generate_text branch April 6, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants