Class OpenAIModel
java.lang.Object
ai.singlr.openai.OpenAIModel
- All Implemented Interfaces:
ai.singlr.core.model.Model, AutoCloseable
OpenAI model implementation using the Responses API.
All requests use SSE streaming internally for robust timeout handling. Synchronous chat(List, List) methods stream under the hood and accumulate the response, avoiding HTTP read timeouts on
long-running generations. A per-line idle timeout detects stalled streams and throws a retryable
OpenAIException.
-
Method Summary
Modifier and TypeMethodDescriptionai.singlr.core.model.Response<Void> <T> ai.singlr.core.model.Response<T> chat(List<ai.singlr.core.model.Message> messages, List<ai.singlr.core.tool.Tool> tools, ai.singlr.core.schema.OutputSchema<T> outputSchema) ai.singlr.core.model.CloseableIterator<ai.singlr.core.model.StreamEvent> chatStream(List<ai.singlr.core.model.Message> messages, List<ai.singlr.core.tool.Tool> tools) voidclose()intid()intprovider()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.singlr.core.model.Model
chat, chat, chatStream
-
Method Details
-
id
- Specified by:
idin interfaceai.singlr.core.model.Model
-
provider
- Specified by:
providerin interfaceai.singlr.core.model.Model
-
contextWindow
public int contextWindow()- Specified by:
contextWindowin interfaceai.singlr.core.model.Model
-
maxOutputTokens
public int maxOutputTokens()- Specified by:
maxOutputTokensin interfaceai.singlr.core.model.Model
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceai.singlr.core.model.Model
-
chat
-
chat
-
chatStream
-