nsmcp::ChatCompletionsRun method tools (protected)
<instance of nsmcp::ChatCompletionsRun> tools
Defined in /usr/local/ns/tcl/nsmcp/question-chat-completions.tcl
- Testcases:
- No testcase defined.
Source code: set context [:context] try {set listed [[${:backend} cget -registry] list $context [${:backend} cget -authorizer]]} finally {$context destroy} set definitions {}; set allowed {}; set i 0 foreach {index type members} [ns_json triples getvalue -output triples -path tools -- $listed] { set item [list {} object $members] set metadata [ns_json parse [ns_json value -- $item]] if {![dict exists $metadata annotations readOnlyHint] || ![dict get $metadata annotations readOnlyHint]} {continue} set name [dict get $metadata name] set parameters [ns_json triples getvalue -output triples -path inputSchema -- $item] lappend definitions $i object [list type string function function object [list name string $name description string [dict get $metadata description] parameters object $parameters]] lappend allowed $name incr i } if {$definitions eq ""} {error "No permitted read-only question tools are available"} return [list $definitions $allowed]XQL Not present: Generic, PostgreSQL, Oracle
![[i]](/resources/acs-subsite/ZoomIn16.gif)