diff --git a/languages/elixir/openai/uncloseai.exs b/languages/elixir/openai/uncloseai.exs index 0b3dc53..16ec0a1 100644 --- a/languages/elixir/openai/uncloseai.exs +++ b/languages/elixir/openai/uncloseai.exs @@ -54,38 +54,7 @@ end # Streaming chat with Model 1 IO.puts("=== Streaming Chat (Model 1) ===") - -stream_req1 = OpenaiEx.Chat.Completions.new( - model: model_1_id, - messages: [ - %{role: "user", content: "Explain quantum entanglement in one sentence."} - ], - temperature: 0.5, - max_tokens: 150, - stream: true -) - -IO.write("Response: ") - -case OpenaiEx.Chat.Completions.create(client1, stream_req1) do - {:ok, stream} -> - stream - |> Stream.each(fn - {:data, chunk} -> - case chunk do - %{"choices" => [%{"delta" => %{"content" => content}} | _]} when not is_nil(content) -> - IO.write(content) - _ -> - :ok - end - _ -> - :ok - end) - |> Stream.run() - IO.puts("\n") - {:error, error} -> - IO.puts("Error: #{inspect(error)}\n") -end +IO.puts("[SKIPPED] Streaming not compatible with vLLM endpoints in openai_ex 0.9.18\n") # Non-streaming chat with Model 2 IO.puts("=== Non-Streaming Chat (Model 2) ===") @@ -112,38 +81,7 @@ end # Streaming chat with Model 2 IO.puts("=== Streaming Chat (Model 2) ===") - -stream_req2 = OpenaiEx.Chat.Completions.new( - model: model_2_id, - messages: [ - %{role: "user", content: "Give a Python Fizzbuzz solution in one line of code?"} - ], - temperature: 0.5, - max_tokens: 150, - stream: true -) - -IO.write("Response: ") - -case OpenaiEx.Chat.Completions.create(client2, stream_req2) do - {:ok, stream} -> - stream - |> Stream.each(fn - {:data, chunk} -> - case chunk do - %{"choices" => [%{"delta" => %{"content" => content}} | _]} when not is_nil(content) -> - IO.write(content) - _ -> - :ok - end - _ -> - :ok - end) - |> Stream.run() - IO.puts("\n") - {:error, error} -> - IO.puts("Error: #{inspect(error)}\n") -end +IO.puts("[SKIPPED] Streaming not compatible with vLLM endpoints in openai_ex 0.9.18\n") # TTS example IO.puts("=== TTS Speech Generation ===")