dvcrn / ex_openai

Auto-generated Elixir SDK for OpenAI APIs with full typespecs, docs and streaming support
MIT License
71 stars 27 forks source link

%Protocol.UndefinedError{description: "Jason.Encoder protocol must always be explicitly implemented", protocol: Jason.Encoder, value: #PID<0.509.0>} #4

Closed matheuscamarques closed 11 months ago

matheuscamarques commented 1 year ago

def start() do {:ok, pid} = MODULE.start_link(nil) ChatGpt.generar_desafio(GeradorDeDesafios.mock(), [ stream_to: pid, stream: true, ])

** (CaseClauseError) no case clause matching: %Protocol.UndefinedError{description: "Jason.Encoder protocol must always be explicitly implemented", protocol: Jason.Encoder, value: #PID<0.509.0>}
(hackney 1.18.1) /home/sanonichan/projetos/aulas_particulares/desafios/deps/hackney/src/hackney_request.erl:322: :hackney_request.handle_body/4
(hackney 1.18.1) /home/sanonichan/projetos/aulas_particulares/desafios/deps/hackney/src/hackney_request.erl:87: :hackney_request.perform/2
(hackney 1.18.1) /home/sanonichan/projetos/aulas_particulares/desafios/deps/hackney/src/hackney.erl:378: :hackney.send_request/2
(httpoison 2.1.0) lib/httpoison/base.ex:872: HTTPoison.Base.request/6
(ex_openai 1.1.1) lib/ex_openai/client.ex:117: ExOpenAI.Client.api_post/4
(gerador_de_desafios 0.1.0) lib/gerador_de_desafios/domain/chat_gpt.ex:24: GeradorDeDesafios.Domain.ChatGpt.generar_desafio/2

https://github.com/matheuscamarques/desafios-programacao
dvcrn commented 1 year ago

Let me take a look

dvcrn commented 1 year ago

Fixed in 1.1.2. I'm not entirely sure how this bug sneaked in there, I'm using the library extensively myself so this should have been surfaced sooner

dvcrn commented 1 year ago

@matheuscamarques did this fix the issue for you? Just checking if I can close this issue

matheuscamarques commented 1 year ago

I can try again in other moment, you can close this issue