Class ChatOpenAI

java.lang.Object
com.hw.langchain.chat.models.base.BaseChatModel
com.hw.langchain.chat.models.openai.ChatOpenAI
All Implemented Interfaces:
BaseLanguageModel

public class ChatOpenAI extends BaseChatModel
Wrapper around OpenAI Chat large language models.
Author:
HamaWhite
  • Field Details

    • client

      protected OpenAiClient client
    • model

      protected String model
      Model name to use.
    • temperature

      protected float temperature
      What sampling temperature to use.
    • modelKwargs

      protected Map<String,Object> modelKwargs
      Holds any model parameters valid for `create` call not explicitly specified.
    • openaiApiKey

      protected String openaiApiKey
      Base URL path for API requests, leave blank if not using a proxy or service emulator.
    • openaiApiBase

      protected String openaiApiBase
    • openaiApiType

      protected OpenaiApiType openaiApiType
    • openaiApiVersion

      protected String openaiApiVersion
    • openaiOrganization

      protected String openaiOrganization
    • openaiProxy

      protected String openaiProxy
      To support explicit proxy for OpenAI.
    • requestTimeout

      protected long requestTimeout
      Timeout for requests to OpenAI completion API. Default is 16 seconds.
    • maxRetries

      protected int maxRetries
      Maximum number of retries to make when generating.
    • stream

      protected boolean stream
      Whether to stream the results or not.
    • n

      protected int n
      Number of chat completions to generate for each prompt.
    • maxTokens

      protected Integer maxTokens
      Maximum number of tokens to generate.
  • Constructor Details

    • ChatOpenAI

      public ChatOpenAI()
  • Method Details