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, chatStream, chatStream
-
Method Details
-
id
-
provider
-
contextWindow
- Specified by:
contextWindowin interfaceai.singlr.core.model.Model
-
maxOutputTokens
- Specified by:
maxOutputTokensin interfaceai.singlr.core.model.Model
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceai.singlr.core.model.Model
-
chat
-
chat
-
chatStream
public 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) - Specified by:
chatStreamin interfaceai.singlr.core.model.Model
-