run_id string Optional (#855)

Filter messages by the run ID that generated them.

Co-authored-by: wappi <support@wappi.pro>
This commit is contained in:
floodwm
2024-09-20 23:54:25 +03:00
committed by GitHub
parent 9a4f3a7dbf
commit e095df5325
4 changed files with 9 additions and 3 deletions

View File

@@ -100,6 +100,7 @@ func (c *Client) ListMessage(ctx context.Context, threadID string,
order *string,
after *string,
before *string,
runID *string,
) (messages MessagesList, err error) {
urlValues := url.Values{}
if limit != nil {
@@ -114,6 +115,10 @@ func (c *Client) ListMessage(ctx context.Context, threadID string,
if before != nil {
urlValues.Add("before", *before)
}
if runID != nil {
urlValues.Add("run_id", *runID)
}
encodedValues := ""
if len(urlValues) > 0 {
encodedValues = "?" + urlValues.Encode()