mirror of
https://github.com/volcengine/OpenViking.git
synced 2026-09-30 17:28:07 +08:00
* fix(models): route multimodal inputs to DashScope embed_content Sweep findings: A-09. Preserve image parts through the shared embedding entrypoints. (cherry picked from commit50b20d7ca9) * fix(models): constrain DashScope multimodal routing Sweep findings: A-09. Preserve text mode and require a single fused vector for multipart input. (cherry picked from commit77784429d4) * fix(models): respect DashScope Qwen fusion parameters Sweep finding A-09 (cherry picked from commitaafc702b20) * fix(review): preserve tongyi multipart compatibility Addresses blocking review finding on #3400. (cherry picked from commit96844047c5) * fix(eval): flush queued records on stop and adapt RAG pipeline to FindResult Sweep findings: B-05, B-12. Drain recorder queues through the sentinel and consume current retrieval result objects. (cherry picked from commitfecdbeb6d4) * fix(sdk/python): support sync client inside a running event loop Sweep findings: F-09. Run sync wrappers on one persistent worker loop with result and exception propagation. (cherry picked from commitba0faadc87) * fix(sdk/python): preserve cancellation and fork safety Sweep finding: F-09. Preserve original cancellation errors and reset worker synchronization after fork. (cherry picked from commita19e3c95e9) * feat(sdk/go): add tags filter and relations API for parity Sweep findings: F-11, F-12. Expose existing server capabilities consistently to Go callers. (cherry picked from commit8af0c2cb36) * fix(sdk/python): runnable quickstarts, correct migrate payload, explicit timeout precedence Sweep findings: F-01, F-02, F-14. Initialize documented clients and preserve Python SDK request/config semantics. (cherry picked from commitd9a64f5665) --------- Co-authored-by: zhiheng.liu <zhiheng.liu@bytedance.com>
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package openviking
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
"net/url"
|
|
)
|
|
|
|
// Relations returns the relations associated with a resource.
|
|
func (c *Client) Relations(ctx context.Context, uri string) ([]map[string]any, error) {
|
|
query := url.Values{"uri": []string{NormalizeURI(uri)}}
|
|
var result []map[string]any
|
|
err := c.doJSON(ctx, http.MethodGet, "/api/v1/relations", query, nil, &result)
|
|
return result, err
|
|
}
|
|
|
|
// Link creates relations from one resource to a string or []string target.
|
|
func (c *Client) Link(ctx context.Context, fromURI string, toURIs any, reason string) error {
|
|
payload := map[string]any{
|
|
"from_uri": NormalizeURI(fromURI),
|
|
"to_uris": normalizeTarget(toURIs),
|
|
"reason": reason,
|
|
}
|
|
return c.doJSON(ctx, http.MethodPost, "/api/v1/relations/link", nil, payload, nil)
|
|
}
|
|
|
|
// Unlink removes a resource relation.
|
|
func (c *Client) Unlink(ctx context.Context, fromURI, toURI string) error {
|
|
payload := map[string]any{
|
|
"from_uri": NormalizeURI(fromURI),
|
|
"to_uri": NormalizeURI(toURI),
|
|
}
|
|
return c.doJSON(ctx, http.MethodDelete, "/api/v1/relations/link", nil, payload, nil)
|
|
}
|