Commit Graph

19 Commits

Author SHA1 Message Date
Claudio Ortolina a1c665b490 ML-21: Classify API errors as transient vs permanent 2026-04-24 14:02:15 +01:00
Claudio Ortolina f7f38d580e Enable unaliased modules ex_slop check 2026-04-22 20:37:09 +01:00
Claudio Ortolina f7628267b3 Add @moduledoc to OpenAI.API 2026-04-13 13:15:43 +01:00
Claudio Ortolina bdc1cd3992 Prevent callback return value from halting stream
The delta branch in decode_responses_event now explicitly returns
:ok after invoking the callback, so a callback returning {:error, _}
cannot be mistaken for a stream-level error by decode_events.
2026-04-13 13:14:33 +01:00
Claudio Ortolina 6fa640f0f6 Remove unreachable catch clause in do_chat_stream 2026-04-13 13:12:58 +01:00
Claudio Ortolina f73be3f881 Handle OpenAI api streaming error messages 2026-04-13 11:54:05 +01:00
Claudio Ortolina 7b5b7e68dd Harden OpenAI api layer
- Support rate limiting
- Add proper error handling (don't rely on exceptions)

Closes #147
2026-04-05 16:01:29 +01:00
Claudio Ortolina 7cf9b4e7f8 First pass at uniformed types, specs and docs
- spec public functions (skipping controllers, views, live views and
components)
- use types instead of explanations in docs
- remove redundant docs
- fix typos
2026-03-06 08:33:11 +00:00
Claudio Ortolina 99674eb8bc Refactor and add tests for OpenAI namespace 2026-03-02 14:11:51 +00:00
Claudio Ortolina 5bd85013c6 Simplify OpenAI api implementation 2026-03-02 13:56:46 +00:00
Claudio Ortolina 78025eba69 Use gpt 4.1 with search 2026-02-22 10:27:44 +00:00
Claudio Ortolina 8d38512712 Fix review blockers in record chat
- Add Task.Supervisor to app supervision tree
- Use tagged tuples instead of rescue for error handling
- Pass embedding_text from parent LiveView as prop
- Remove dead Completion struct fields
- Extract socket assigns before Task closure
- Log errors server-side, show generic user message
- Make build_system_prompt private, remove thin wrapper
- Extract do_send_message for retry reuse

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 10:20:58 +00:00
Claudio Ortolina 6e6e419801 Add record chat sheet with OpenAI streaming
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 10:13:05 +00:00
Claudio Ortolina da464a52e0 Fix error handling pattern match error 2025-08-11 12:00:59 +03:00
Claudio Ortolina 133b4695cf Enforce timeouts when using the OpenAI api 2025-03-29 20:02:26 +00:00
Claudio Ortolina 502436c987 Move api_key resolution to OpenAI module 2025-02-20 09:17:28 +00:00
Claudio Ortolina 85b403817f Move model definition into completion struct 2024-12-29 20:58:09 +00:00
Claudio Ortolina 9dce1cacb9 Where possible, use built-in JSON instead of Jason
Note that it's not possible to replace any call where we encode and
pretty print, as JSON doesn't have such functionality.
2024-12-19 20:18:09 +00:00
Claudio Ortolina 832e835252 Add function to get embeddings for arbitrary string 2024-12-18 22:20:41 +00:00