Releases: ianrothmann/langserve-php-client
Release list
Added SSL Verification Option
You can now pass verifySsl in the constructor. It is true by default.
Added an idle timeout
Bug Fix with mixed for older php versions
1.0.1 Issue with mixed on php 7.4
Initial Release
This release is now backwards compatible >= php 7.4 if required in legacy projects
Added a X-Trace-Id header
For tracking calls to remote runnables. This needs to be implemented in LangServe as follows:
import contextvars
trace_id_var = contextvars.ContextVar("trace_id", default=None)
async def set_trace_id(x_trace_id: Optional[str] = Header(None)):
if x_trace_id:
trace_id_var.set(x_trace_id)
dependencies.append(Depends(set_trace_id))
app = FastAPI(
title="AINinja Server",
version="1.0",
dependencies=dependencies,
)
def config_modifier(config: RunnableConfig, ctx):
if "tags" not in config:
config["tags"] = []
if trace_id_var.get():
config["tags"].append(trace_id_var.get())
return config
add_routes(
app,
runnable,
path=path,
per_req_config_modifier=config_modifier,
)
This then creates a tag in LangSmith for the trace ID
Bug fix in Streamed Response
Tested with LangChain 0.2, when using llm.with_structured_output(PydanticModel), it sends json back in events. It now only uses the final json sent.
Pooled async execution supported
0.0.5 Async calls - RemoteRunnablePool
Release with minor updates (pre-production)
0.0.4 Better handling of content keys in streaming responses
More flexible options with headers and authentication
You have some different options for adding headers and authentication:
$runnable->authenticateWithBearerToken('your-token'); //Add a Bearer token header with the token
$runnable->authenticateWithXToken('your-token'); //Add the X-Token header, if you implemented it according to the LangServe
$runnable->addHeader('Key', 'Value'); //Add any other header
Initial version with some bug fixes
Batch call: Ensured a valid set of RemoteRunnableResponse as if it was called with invoke