Skip to content

Conversation

@yunfengzhou-hub
Copy link
Contributor

What is the purpose of the change

This PR proposes to pass several OpenAI API parameters through model function parameter, in order to better support controlling the randomness and format of Chat Model Function.

Brief change log

The following parameters are proposed to be passed

  • presence-penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
  • n: How many chat completion choices to generate for each input message.
  • seed: the random seed to generate results
  • response-format: The format of the response, e.g., 'text' or 'json_object'.

Verifying this change

Unit tests are added to OpenAIChatModelTest to verify the newly introduced parameters.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): yes
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): yes
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? docs

@flinkbot
Copy link
Collaborator

flinkbot commented Oct 27, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@yunfengzhou-hub yunfengzhou-hub marked this pull request as ready for review October 27, 2025 08:01
Copy link
Contributor

@Sxnan Sxnan left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! LGTM

@Sxnan Sxnan merged commit e763929 into apache:master Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants