Back to Flink

Model Openai Common Section

docs/layouts/shortcodes/generated/model_openai_common_section.html

0.4-rc11.9 KB
Original Source
KeyDefaultTypeDescription
api-key

| (none) | String | OpenAI API key for authentication. | |

context-overflow-action

| truncated-tail |

Enum

| Action to handle context overflows.

Possible values:

  • "truncated-tail": Truncates exceeded tokens from the tail of the context.
  • "truncated-tail-log": Truncates exceeded tokens from the tail of the context. Records the truncation log.
  • "truncated-head": Truncates exceeded tokens from the head of the context.
  • "truncated-head-log": Truncates exceeded tokens from the head of the context. Records the truncation log.
  • "skipped": Skips the input row.
  • "skipped-log": Skips the input row. Records the skipping log.

| |

endpoint

| (none) | String | Full URL of the OpenAI API endpoint, e.g., https://api.openai.com/v1/chat/completions or https://api.openai.com/v1/embeddings | |

error-handling-strategy

| RETRY |

Enum

| Strategy for handling errors during model requests.

Possible values:

  • "RETRY": Retry sending the request.
  • "FAILOVER": Throw exceptions and fail the Flink job.
  • "IGNORE": Ignore the input that caused the error and continue. The error itself would be recorded in log.

| |

max-context-size

| (none) | Integer | Max number of tokens for context. context-overflow-action would be triggered if this threshold is exceeded. | |

model

| (none) | String | Model name, e.g., gpt-3.5-turbo, text-embedding-ada-002. | |

retry-fallback-strategy

| FAILOVER |

Enum

| Fallback strategy to employ if the retry attempts are exhausted. This strategy is applied when error-handling-strategy is set to retry.

Possible values:

  • "FAILOVER": Throw exceptions and fail the Flink job.
  • "IGNORE": Ignore the input that caused the error and continue. The error itself would be recorded in log.

| |

retry-num

| 100 | Integer | Number of retry for OpenAI client requests. |