Add getter methods for response and toolcall in Context

Introduce `Response()` and `ToolCall()` methods to access the respective fields from the `Context` struct. This enhances encapsulation and provides a standardized way to retrieve these values.
This commit is contained in:
Steve Dudenhoeffer 2025-03-18 03:45:38 -04:00
parent 88fbf89a63
commit 52533238d3

View File

@ -47,6 +47,14 @@ func (c *Context) Request() Request {
return c.request
}
func (c *Context) Response() *ResponseChoice {
return c.response
}
func (c *Context) ToolCall() *ToolCall {
return c.toolcall
}
func (c *Context) WithContext(ctx context.Context) *Context {
return &Context{Context: ctx, request: c.request, response: c.response, toolcall: c.toolcall}
}