TestLlm.Req (test_llm v0.1.0)

View Source

Stubing LLM responses with Req.Test

Summary

Functions

Stubs the expected response.

Stubs the expected stream response.

Returns the req test plug to use pass to req as a plug option.

Functions

expect_response(key)

Stubs the expected response.

Options

Basic request options:

  • :key - stub reponse file name transformed to slug.
  • :rerun - should the request be rerun and saved, defaults to :false.
  • :model - should the request be rerun and saved, defaults to the name of the model from the request if available.

expect_stream_response(key)

Stubs the expected stream response.

Options

Basic request options:

  • :key - stub reponse file name transformed to slug.
  • :rerun - should the request be rerun and saved, defaults to :false.
  • :model - should the request be rerun and saved, defaults to the name of the model from the request if available.

plug()

Returns the req test plug to use pass to req as a plug option.