mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-16 11:49:43 +02:00
Lot 6 : parité de la boucle d'un tour avec le Go (journaux de référence)
internal/loki/parity_test.go rejoue 19 scénarios dans runChatTools contre un faux moteur aux réponses scriptées, outils aux résultats fixés (execToolHook, nil en service) : réponse simple, raisonnement, outils seuls et en parallèle, appel répété, arguments illisibles, outil inconnu, budget dépassé, « pensé sans agir » une et deux fois, pensée en ligne, échantillonnage et intensité, raisonnement coupé, 500 une et deux fois, erreur du moteur, appel d'outil écrit en texte, API externe, historique déjà outillé. Les corps envoyés au moteur, les événements d'affichage (texte regroupé, mesures ignorées), l'historique ajouté et l'erreur sont rangés dans rust/loki-rs/tests/parity/*.json ; le test Go échoue si la boucle ne les produit plus (LOKI_PARITY_UPDATE=1 pour régénérer). rust/loki-rs/tests/parity.rs rejoue les mêmes scénarios dans chat::turn::run_turn et retrouve les 19 journaux à l'identique. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016tcGfJWefW5kUGoC2wL8cv
This commit is contained in:
22 files changed
+6250
-1
No files matched your search
@@ -2366,7 +2366,12 @@ func runChatLoop(ctx context.Context, kt *keepImages, messages []Message, tools
|
||||
extra = append(extra, toolMsg)
|
||||
continue
|
||||
}
|
||||
ex := execTool(ctx, tc.Function.Name, args, label, caps)
|
||||
var ex toolExecResult
|
||||
if execToolHook != nil {
|
||||
ex = execToolHook(ctx, tc.Function.Name, args, label, caps)
|
||||
} else {
|
||||
ex = execTool(ctx, tc.Function.Name, args, label, caps)
|
||||
}
|
||||
result, diff, diffAdd, diffDel, visionImg = ex.Result, ex.Diff, ex.Added, ex.Removed, ex.VisionImg
|
||||
if ex.Ask != nil {
|
||||
cb(StreamEvent{Ask: ex.Ask})
|
||||
@@ -2609,6 +2614,10 @@ type toolExecResult struct {
|
||||
Ask *AskEvent `json:"ask,omitempty"`
|
||||
}
|
||||
|
||||
// execToolHook : nil en service. Les tests de parité Go/Rust
|
||||
// (parity_test.go) y fixent les résultats des outils.
|
||||
var execToolHook func(ctx context.Context, name string, args map[string]any, label string, caps Caps) toolExecResult
|
||||
|
||||
// execTool exécute UN appel d'outil. Extrait tel quel de runChatLoop (lot 6
|
||||
// de la migration Rust) : c'est la frontière par laquelle une boucle de chat
|
||||
// écrite en Rust fera exécuter ses outils par ce process, tant qu'ils n'auront
|
||||
|
||||
@@ -0,0 +1,425 @@
|
||||
package loki
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// parity_test.go — journaux de référence de la boucle d'un tour (lot 6 de la
|
||||
// migration Rust).
|
||||
//
|
||||
// Chaque scénario rejoue runChatTools contre un faux moteur aux réponses
|
||||
// scriptées, outils aux résultats fixés (execToolHook). Ce qui en sort — corps
|
||||
// des requêtes envoyées au moteur, événements d'affichage, messages ajoutés à
|
||||
// l'historique, erreur — est rangé dans rust/loki-rs/tests/parity/<nom>.json.
|
||||
// Le test Rust (tests/parity.rs) rejoue les mêmes scénarios dans chat::turn et
|
||||
// doit retrouver EXACTEMENT ces journaux : l'octet envoyé au moteur compte (le
|
||||
// cache de préfixe en dépend), l'affichage aussi.
|
||||
//
|
||||
// Ici, le journal produit doit être celui qui est rangé : un changement de
|
||||
// comportement de la boucle Go se voit, et se régénère sciemment —
|
||||
//
|
||||
// LOKI_PARITY_UPDATE=1 go test ./internal/loki -run TestPariteJournaux
|
||||
//
|
||||
// — après quoi le test Rust dit si le port suit.
|
||||
|
||||
const parityDir = "../../rust/loki-rs/tests/parity"
|
||||
|
||||
// parityReply : une réponse scriptée du moteur. Lignes du corps, chacune
|
||||
// suivie d'une ligne vide (trames SSE).
|
||||
type parityReply struct {
|
||||
Status int `json:"status"`
|
||||
Lines []string `json:"lines"`
|
||||
}
|
||||
|
||||
type parityScenario struct {
|
||||
Name string `json:"name"`
|
||||
Cfg map[string]string `json:"cfg"`
|
||||
Messages []Message `json:"messages"`
|
||||
Tools []Tool `json:"tools"`
|
||||
Temperature float64 `json:"temperature"`
|
||||
Replies []parityReply `json:"replies"`
|
||||
ToolResults map[string]string `json:"tool_results"`
|
||||
}
|
||||
|
||||
type parityExpect struct {
|
||||
Requests []any `json:"requests"`
|
||||
Events []map[string]any `json:"events"`
|
||||
Extra []Message `json:"extra"`
|
||||
Err string `json:"err"`
|
||||
}
|
||||
|
||||
type parityFixture struct {
|
||||
parityScenario
|
||||
Expect parityExpect `json:"expect"`
|
||||
}
|
||||
|
||||
// --- Trames du faux moteur --------------------------------------------------
|
||||
|
||||
func pDelta(delta map[string]any) string {
|
||||
b, _ := json.Marshal(map[string]any{"choices": []any{map[string]any{"delta": delta}}})
|
||||
return "data: " + string(b)
|
||||
}
|
||||
|
||||
func pContent(s string) string { return pDelta(map[string]any{"content": s}) }
|
||||
func pReasoning(s string) string { return pDelta(map[string]any{"reasoning_content": s}) }
|
||||
|
||||
func pToolCall(i int, id, name, args string) string {
|
||||
return pDelta(map[string]any{"tool_calls": []any{map[string]any{
|
||||
"index": i, "id": id, "type": "function",
|
||||
"function": map[string]any{"name": name, "arguments": args},
|
||||
}}})
|
||||
}
|
||||
|
||||
func pFinish(reason string) string {
|
||||
b, _ := json.Marshal(map[string]any{
|
||||
"choices": []any{map[string]any{"delta": map[string]any{}, "finish_reason": reason}},
|
||||
"usage": map[string]any{"prompt_tokens": 100, "completion_tokens": 5},
|
||||
})
|
||||
return "data: " + string(b)
|
||||
}
|
||||
|
||||
func pOK(lines ...string) parityReply {
|
||||
return parityReply{Status: 200, Lines: append(lines, "data: [DONE]")}
|
||||
}
|
||||
|
||||
// --- Scénarios ---------------------------------------------------------------
|
||||
|
||||
func parityScenarios() []parityScenario {
|
||||
sys := Message{Role: "system", Content: "Tu es Loki."}
|
||||
user := func(s string) Message { return Message{Role: "user", Content: s} }
|
||||
tools := []Tool{readTool(), bashTool()}
|
||||
base := func(name string, msgs []Message, replies ...parityReply) parityScenario {
|
||||
return parityScenario{
|
||||
Name: name, Cfg: map[string]string{}, Messages: msgs, Tools: tools,
|
||||
Temperature: 0.7, Replies: replies,
|
||||
ToolResults: map[string]string{"read": "ligne 1\nligne 2", "bash": "a.txt\nb.txt"},
|
||||
}
|
||||
}
|
||||
return []parityScenario{
|
||||
base("reponse_simple", []Message{sys, user("Bonjour")},
|
||||
pOK(pContent("Bon"), pContent("jour !"), pFinish("stop"))),
|
||||
|
||||
base("raisonnement_puis_reponse", []Message{sys, user("Combien font 2+2 ?")},
|
||||
pOK(pReasoning("Je calcule."), pReasoning(" 4."), pContent("4"), pFinish("stop"))),
|
||||
|
||||
base("outil_puis_reponse", []Message{sys, user("Lis a.txt")},
|
||||
pOK(pToolCall(0, "c1", "read", `{"file":"a.txt"}`), pFinish("tool_calls")),
|
||||
pOK(pContent("Le fichier a deux lignes."), pFinish("stop"))),
|
||||
|
||||
base("deux_outils_en_parallele", []Message{sys, user("Liste puis lis")},
|
||||
pOK(pToolCall(0, "c1", "bash", `{"command":"ls"}`),
|
||||
pToolCall(1, "c2", "read", `{"file":"a.txt"}`), pFinish("tool_calls")),
|
||||
pOK(pContent("Fait."), pFinish("stop"))),
|
||||
|
||||
base("appel_repete", []Message{sys, user("Lis a.txt")},
|
||||
pOK(pToolCall(0, "c1", "read", `{"file":"a.txt"}`), pFinish("tool_calls")),
|
||||
pOK(pToolCall(0, "c2", "read", `{"file":"a.txt"}`), pFinish("tool_calls")),
|
||||
pOK(pContent("Toujours deux lignes."), pFinish("stop"))),
|
||||
|
||||
base("arguments_illisibles", []Message{sys, user("Lis a.txt")},
|
||||
pOK(pToolCall(0, "c1", "read", `{"file":`), pFinish("tool_calls")),
|
||||
pOK(pContent("Pardon."), pFinish("stop"))),
|
||||
|
||||
base("pense_sans_agir", []Message{sys, user("Cherche")},
|
||||
pOK(pReasoning("Il faudrait lister les fichiers."), pFinish("stop")),
|
||||
pOK(pContent("Voilà."), pFinish("stop"))),
|
||||
|
||||
base("erreur_500_avec_outils", []Message{sys, user("Bonjour")},
|
||||
parityReply{Status: 500, Lines: []string{`{"error":{"code":500,"message":"Failed to parse tool call","type":"server_error"}}`}},
|
||||
pOK(pContent("Salut."), pFinish("stop"))),
|
||||
|
||||
base("erreur_moteur", []Message{sys, user("Bonjour")},
|
||||
parityReply{Status: 400, Lines: []string{`{"error":{"code":400,"message":"requête invalide","type":"invalid_request_error"}}`}}),
|
||||
|
||||
base("appel_textuel", []Message{sys, user("Lis a.txt")},
|
||||
pOK(pContent(`<tool_call>{"name":"read","arguments":{"file":"a.txt"}}</tool_call>`), pFinish("stop")),
|
||||
pOK(pToolCall(0, "c1", "read", `{"file":"a.txt"}`), pFinish("tool_calls")),
|
||||
pOK(pContent("Deux lignes."), pFinish("stop"))),
|
||||
|
||||
base("outil_inconnu", []Message{sys, user("Fais-le")},
|
||||
pOK(pToolCall(0, "c1", "voler", `{}`), pFinish("tool_calls")),
|
||||
pOK(pContent("Impossible."), pFinish("stop"))),
|
||||
|
||||
with(base("budget_depasse", []Message{sys, user("Explore")},
|
||||
pOK(pToolCall(0, "c1", "bash", `{"command":"ls 1"}`), pFinish("tool_calls")),
|
||||
pOK(pToolCall(0, "c2", "bash", `{"command":"ls 2"}`), pFinish("tool_calls")),
|
||||
pOK(pToolCall(0, "c3", "bash", `{"command":"ls 3"}`), pFinish("tool_calls")),
|
||||
pOK(pContent("J'arrête là."), pFinish("stop"))),
|
||||
"AGENT_BUDGET", "2"),
|
||||
|
||||
base("pense_sans_agir_deux_fois", []Message{sys, user("Cherche")},
|
||||
pOK(pReasoning("Lister les fichiers."), pFinish("stop")),
|
||||
pOK(pReasoning("Toujours lister."), pFinish("stop")),
|
||||
pOK(pContent("Voilà."), pFinish("stop"))),
|
||||
|
||||
with(base("pensee_en_ligne", []Message{sys, user("Salut")},
|
||||
pOK(pContent("<think>Il dit bonjour."), pContent("</think>Bonjour !"), pFinish("stop"))),
|
||||
"REASONING", "on"),
|
||||
|
||||
with(with(with(base("echantillonnage_et_effort", []Message{sys, user("Salut")},
|
||||
pOK(pContent("Bonjour."), pFinish("stop"))),
|
||||
"TOP_P", "0.9"), "TOP_K", "40"), "REASONING_EFFORT", "low"),
|
||||
|
||||
with(base("raisonnement_coupe", []Message{sys, user("Salut")},
|
||||
pOK(pContent("Bonjour."), pFinish("stop"))),
|
||||
"REASONING", "off"),
|
||||
|
||||
base("erreur_500_deux_fois", []Message{sys, user("Bonjour")},
|
||||
parityReply{Status: 500, Lines: []string{`{"error":{"code":500,"message":"Failed to parse tool call","type":"server_error"}}`}},
|
||||
parityReply{Status: 500, Lines: []string{`{"error":{"code":500,"message":"Failed to parse tool call","type":"server_error"}}`}},
|
||||
pOK(pContent("Salut."), pFinish("stop"))),
|
||||
|
||||
with(with(with(base("api_externe", []Message{sys, user("Lis a.txt")},
|
||||
pOK(pReasoning("Je lis."), pToolCall(0, "c1", "read", `{"file":"a.txt"}`), pFinish("tool_calls")),
|
||||
pOK(pContent("Deux lignes."), pFinish("stop"))),
|
||||
extKeyFlag, "1"), extKeyURL, parityURL), extKeyModel, "gpt-x"),
|
||||
|
||||
base("historique_avec_outils", []Message{sys, user("Lis a.txt"),
|
||||
{Role: "assistant", ToolCalls: []ToolCall{{ID: "c0", Type: "function", Function: ToolCallFunc{Name: "read", Arguments: `{"file":"a.txt"}`}}}},
|
||||
{Role: "tool", ToolCallID: "c0", Content: "ligne 1"},
|
||||
{Role: "assistant", Content: "Une ligne."},
|
||||
user("Et b.txt ?")},
|
||||
pOK(pToolCall(0, "c1", "read", `{"file":"b.txt"}`), pFinish("tool_calls")),
|
||||
pOK(pContent("Deux lignes."), pFinish("stop"))),
|
||||
}
|
||||
}
|
||||
|
||||
// parityURL : remplacé par l'adresse du faux moteur au rejeu (côté Rust,
|
||||
// l'adresse ne compte pas : l'hôte répond lui-même).
|
||||
const parityURL = "{{URL}}"
|
||||
|
||||
// with pose une clé de configuration sur le scénario.
|
||||
func with(sc parityScenario, k, v string) parityScenario {
|
||||
cfg := map[string]string{}
|
||||
for a, b := range sc.Cfg {
|
||||
cfg[a] = b
|
||||
}
|
||||
cfg[k] = v
|
||||
sc.Cfg = cfg
|
||||
return sc
|
||||
}
|
||||
|
||||
// --- Rejeu côté Go -------------------------------------------------------------
|
||||
|
||||
// parityEvent : forme comparable d'un événement (nil : ignoré — mesures, qui
|
||||
// dépendent du temps).
|
||||
func parityEvent(ev StreamEvent) map[string]any {
|
||||
switch {
|
||||
case ev.Content != "":
|
||||
return map[string]any{"content": ev.Content}
|
||||
case ev.Reasoning != "":
|
||||
return map[string]any{"reasoning": ev.Reasoning}
|
||||
case ev.ToolUsed != nil:
|
||||
t := ev.ToolUsed
|
||||
m := map[string]any{"name": t.Name}
|
||||
put := func(k string, v any, keep bool) {
|
||||
if keep {
|
||||
m[k] = v
|
||||
}
|
||||
}
|
||||
put("label", t.Label, t.Label != "")
|
||||
put("result", t.Result, t.Result != "")
|
||||
put("done", true, t.Done)
|
||||
put("typing", true, t.Typing)
|
||||
put("body", t.Body, t.Body != "")
|
||||
put("body_tail", true, t.BodyTail)
|
||||
put("body_lines", t.BodyLines, t.BodyLines != 0)
|
||||
put("diff", t.Diff, len(t.Diff) > 0)
|
||||
put("added", t.Added, t.Added != 0)
|
||||
put("removed", t.Removed, t.Removed != 0)
|
||||
put("image", t.Image, t.Image != "")
|
||||
put("shot", t.Shot, t.Shot != "")
|
||||
put("result_chars", t.ResultChars, t.ResultChars != 0)
|
||||
put("result_id", t.ResultID, t.ResultID != "")
|
||||
return map[string]any{"tool_used": m}
|
||||
case ev.Ask != nil:
|
||||
return map[string]any{"ask": ev.Ask}
|
||||
case ev.Err != nil:
|
||||
return map[string]any{"err": ev.Err.Error()}
|
||||
case ev.DropReasoning:
|
||||
return map[string]any{"drop_reasoning": true}
|
||||
case ev.Compacting != nil:
|
||||
return map[string]any{"compacting": *ev.Compacting}
|
||||
case ev.NewHistory != nil:
|
||||
return map[string]any{"new_history": ev.NewHistory}
|
||||
case ev.Echo != nil:
|
||||
return map[string]any{"echo": map[string]any{"text": ev.Echo.Text, "model": ev.Echo.Model}}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// parityMerge regroupe les fragments consécutifs de texte : le découpage
|
||||
// d'un flux en événements n'est pas un comportement.
|
||||
func parityMerge(evs []map[string]any) []map[string]any {
|
||||
var out []map[string]any
|
||||
for _, e := range evs {
|
||||
if n := len(out); n > 0 {
|
||||
for _, k := range []string{"content", "reasoning"} {
|
||||
a, ok1 := out[n-1][k].(string)
|
||||
b, ok2 := e[k].(string)
|
||||
if ok1 && ok2 && len(out[n-1]) == 1 && len(e) == 1 {
|
||||
out[n-1] = map[string]any{k: a + b}
|
||||
e = nil
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if e != nil {
|
||||
out = append(out, e)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func runParity(t *testing.T, sc parityScenario) parityExpect {
|
||||
t.Helper()
|
||||
testHome(t)
|
||||
var (
|
||||
mu sync.Mutex
|
||||
requests []any
|
||||
next int
|
||||
)
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if !strings.HasSuffix(r.URL.Path, "/chat/completions") {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
raw, _ := io.ReadAll(r.Body)
|
||||
var body any
|
||||
_ = json.Unmarshal(raw, &body)
|
||||
mu.Lock()
|
||||
requests = append(requests, body)
|
||||
i := next
|
||||
next++
|
||||
mu.Unlock()
|
||||
if i >= len(sc.Replies) {
|
||||
t.Errorf("%s : requête %d non scriptée", sc.Name, i+1)
|
||||
http.Error(w, "non scripté", http.StatusTeapot)
|
||||
return
|
||||
}
|
||||
rep := sc.Replies[i]
|
||||
if rep.Status == 200 {
|
||||
w.Header().Set("Content-Type", "text/event-stream")
|
||||
} else {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
}
|
||||
w.WriteHeader(rep.Status)
|
||||
var b strings.Builder
|
||||
for _, l := range rep.Lines {
|
||||
b.WriteString(l + "\n\n")
|
||||
}
|
||||
_, _ = w.Write([]byte(b.String()))
|
||||
}))
|
||||
t.Cleanup(srv.Close)
|
||||
u, err := url.Parse(srv.URL)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
cfg := map[string]string{"PORT": u.Port()}
|
||||
for k, v := range sc.Cfg {
|
||||
cfg[k] = strings.ReplaceAll(v, parityURL, srv.URL)
|
||||
}
|
||||
if err := WriteConfig(cfg); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
execToolHook = func(_ context.Context, name string, _ map[string]any, _ string, _ Caps) toolExecResult {
|
||||
if r, ok := sc.ToolResults[name]; ok {
|
||||
return toolExecResult{Result: r}
|
||||
}
|
||||
return toolExecResult{Result: "[erreur] outil inconnu : " + name}
|
||||
}
|
||||
t.Cleanup(func() { execToolHook = nil })
|
||||
|
||||
var evs []map[string]any
|
||||
msgs := append([]Message(nil), sc.Messages...)
|
||||
extra, err := runChatTools(context.Background(), msgs, sc.Tools, sc.Temperature, Caps{}, func(ev StreamEvent) bool {
|
||||
if e := parityEvent(ev); e != nil {
|
||||
evs = append(evs, e)
|
||||
}
|
||||
return true
|
||||
})
|
||||
exp := parityExpect{Requests: requests, Events: parityMerge(evs), Extra: extra}
|
||||
if err != nil {
|
||||
exp.Err = err.Error()
|
||||
}
|
||||
if exp.Requests == nil {
|
||||
exp.Requests = []any{}
|
||||
}
|
||||
if exp.Events == nil {
|
||||
exp.Events = []map[string]any{}
|
||||
}
|
||||
if exp.Extra == nil {
|
||||
exp.Extra = []Message{}
|
||||
}
|
||||
return exp
|
||||
}
|
||||
|
||||
// parityJSON : JSON stable (clés triées par encoding/json), indenté.
|
||||
func parityJSON(v any) ([]byte, error) {
|
||||
var buf bytes.Buffer
|
||||
enc := json.NewEncoder(&buf)
|
||||
enc.SetEscapeHTML(false)
|
||||
enc.SetIndent("", " ")
|
||||
if err := enc.Encode(v); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
func TestPariteJournaux(t *testing.T) {
|
||||
update := os.Getenv("LOKI_PARITY_UPDATE") == "1"
|
||||
seen := map[string]bool{}
|
||||
for _, sc := range parityScenarios() {
|
||||
t.Run(sc.Name, func(t *testing.T) {
|
||||
if seen[sc.Name] {
|
||||
t.Fatalf("scénario en double : %s", sc.Name)
|
||||
}
|
||||
seen[sc.Name] = true
|
||||
fx := parityFixture{parityScenario: sc, Expect: runParity(t, sc)}
|
||||
got, err := parityJSON(fx)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
path := filepath.Join(parityDir, sc.Name+".json")
|
||||
if update {
|
||||
if err := os.MkdirAll(parityDir, 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(path, got, 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return
|
||||
}
|
||||
want, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatalf("journal de référence absent (%v) : LOKI_PARITY_UPDATE=1 pour le créer", err)
|
||||
}
|
||||
if !bytes.Equal(got, want) {
|
||||
t.Errorf("la boucle Go ne produit plus le journal rangé dans %s.\n"+
|
||||
"Si c'est voulu : LOKI_PARITY_UPDATE=1 go test ./internal/loki -run TestPariteJournaux,\n"+
|
||||
"puis cargo test --test parity dit si le port Rust suit.\n--- obtenu ---\n%s", path, got)
|
||||
}
|
||||
})
|
||||
}
|
||||
if update {
|
||||
return
|
||||
}
|
||||
// Pas de journal orphelin : un scénario retiré ici l'est aussi là-bas.
|
||||
files, _ := filepath.Glob(filepath.Join(parityDir, "*.json"))
|
||||
for _, f := range files {
|
||||
if name := strings.TrimSuffix(filepath.Base(f), ".json"); !seen[name] {
|
||||
t.Errorf("journal sans scénario : %s", f)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,284 @@
|
||||
//! Parité de la boucle d'un tour avec le Go (lot 6).
|
||||
//!
|
||||
//! `tests/parity/*.json` : journaux de référence produits par la boucle Go
|
||||
//! (`internal/loki/parity_test.go`, régénérés par
|
||||
//! `LOKI_PARITY_UPDATE=1 go test ./internal/loki -run TestPariteJournaux`).
|
||||
//! Chaque scénario est rejoué ici dans `chat::turn::run_turn`, sur un hôte qui
|
||||
//! sert les mêmes réponses du moteur et les mêmes résultats d'outils. Doivent
|
||||
//! se retrouver à l'identique : les corps envoyés au moteur (le cache de
|
||||
//! préfixe en dépend), les événements d'affichage (texte regroupé, mesures
|
||||
//! ignorées), les messages ajoutés à l'historique et l'erreur.
|
||||
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use std::path::PathBuf;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use bytes::Bytes;
|
||||
use serde::Deserialize;
|
||||
use serde_json::{Map, Value, json};
|
||||
|
||||
use loki_rs::chat::compact::CompactConfig;
|
||||
use loki_rs::chat::stream::RetryPatterns;
|
||||
use loki_rs::chat::turn::{
|
||||
Cancel, CompactPhase, Reply, SendError, ToolOutcome, TurnConfig, TurnHost, run_turn,
|
||||
};
|
||||
use loki_rs::chat::types::{Message, StreamEvent, Tool};
|
||||
use loki_rs::chat::wire::{
|
||||
ChatEndpoint, EchoRefusals, EffortFallbacks, echo_policy_for, resolve_chat_endpoint,
|
||||
turn_reasoning,
|
||||
};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct ReplyFx {
|
||||
status: u16,
|
||||
lines: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct Expect {
|
||||
requests: Vec<Value>,
|
||||
events: Vec<Value>,
|
||||
extra: Value,
|
||||
err: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct Fixture {
|
||||
name: String,
|
||||
cfg: HashMap<String, String>,
|
||||
messages: Vec<Message>,
|
||||
tools: Vec<Tool>,
|
||||
temperature: f64,
|
||||
replies: Vec<ReplyFx>,
|
||||
tool_results: HashMap<String, String>,
|
||||
expect: Expect,
|
||||
}
|
||||
|
||||
/// Hôte du rejeu : le moteur répond selon le script, les outils selon la
|
||||
/// table du scénario — exactement ce que voit la boucle Go.
|
||||
struct ParityHost {
|
||||
replies: Mutex<VecDeque<ReplyFx>>,
|
||||
tool_results: HashMap<String, String>,
|
||||
requests: Mutex<Vec<Value>>,
|
||||
}
|
||||
|
||||
impl TurnHost for ParityHost {
|
||||
async fn send(&self, _ep: &ChatEndpoint, body: Vec<u8>) -> Result<Reply, SendError> {
|
||||
self.requests
|
||||
.lock()
|
||||
.unwrap()
|
||||
.push(serde_json::from_slice(&body).expect("corps JSON"));
|
||||
let r = self
|
||||
.replies
|
||||
.lock()
|
||||
.unwrap()
|
||||
.pop_front()
|
||||
.expect("requête non scriptée");
|
||||
let chunks: Vec<Result<Bytes, String>> = r
|
||||
.lines
|
||||
.into_iter()
|
||||
.map(|l| Ok(Bytes::from(format!("{l}\n\n"))))
|
||||
.collect();
|
||||
Ok(Reply {
|
||||
status: r.status,
|
||||
body: Box::pin(futures_util::stream::iter(chunks)),
|
||||
})
|
||||
}
|
||||
|
||||
async fn exec_tool(&self, name: &str, _args: &Map<String, Value>, _label: &str) -> ToolOutcome {
|
||||
ToolOutcome {
|
||||
result: self
|
||||
.tool_results
|
||||
.get(name)
|
||||
.cloned()
|
||||
.unwrap_or_else(|| format!("[erreur] outil inconnu : {name}")),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
fn save_tool_result(&self, _result: &str) -> String {
|
||||
String::new()
|
||||
}
|
||||
|
||||
async fn compact(&self, _phase: CompactPhase, _msgs: &[Message]) -> Option<Vec<Message>> {
|
||||
None
|
||||
}
|
||||
|
||||
fn drain_queued(&self) -> Vec<Message> {
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
fn image_data_url(&self, _r: &str) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
fn effort_remember(&self, _want: &str, _got: &str) {}
|
||||
|
||||
fn echo_refuse(&self, _model: &str) {}
|
||||
}
|
||||
|
||||
/// Forme comparable d'un événement — `parityEvent` du Go (`None` : mesures).
|
||||
fn event(ev: &StreamEvent) -> Option<Value> {
|
||||
Some(match ev {
|
||||
StreamEvent::Content(s) if !s.is_empty() => json!({ "content": s }),
|
||||
StreamEvent::Reasoning(s) if !s.is_empty() => json!({ "reasoning": s }),
|
||||
StreamEvent::Content(_) | StreamEvent::Reasoning(_) | StreamEvent::Stats(_) => {
|
||||
return None;
|
||||
}
|
||||
StreamEvent::ToolUsed(t) => {
|
||||
let mut m = Map::new();
|
||||
m.insert("name".into(), json!(t.name));
|
||||
let mut put = |k: &str, v: Value, keep: bool| {
|
||||
if keep {
|
||||
m.insert(k.into(), v);
|
||||
}
|
||||
};
|
||||
put("label", json!(t.label), !t.label.is_empty());
|
||||
put("result", json!(t.result), !t.result.is_empty());
|
||||
put("done", json!(true), t.done);
|
||||
put("typing", json!(true), t.typing);
|
||||
put("body", json!(t.body), !t.body.is_empty());
|
||||
put("body_tail", json!(true), t.body_tail);
|
||||
put("body_lines", json!(t.body_lines), t.body_lines != 0);
|
||||
put("diff", json!(t.diff), !t.diff.is_empty());
|
||||
put("added", json!(t.added), t.added != 0);
|
||||
put("removed", json!(t.removed), t.removed != 0);
|
||||
put("image", json!(t.image), !t.image.is_empty());
|
||||
put("shot", json!(t.shot), !t.shot.is_empty());
|
||||
put("result_chars", json!(t.result_chars), t.result_chars != 0);
|
||||
put("result_id", json!(t.result_id), !t.result_id.is_empty());
|
||||
json!({ "tool_used": m })
|
||||
}
|
||||
StreamEvent::Ask(a) => json!({ "ask": a }),
|
||||
StreamEvent::Err(e) => json!({ "err": e }),
|
||||
StreamEvent::DropReasoning => json!({ "drop_reasoning": true }),
|
||||
StreamEvent::Compacting(b) => json!({ "compacting": b }),
|
||||
StreamEvent::NewHistory(h) => json!({ "new_history": h }),
|
||||
StreamEvent::Echo(e) => json!({ "echo": { "text": e.text, "model": e.model } }),
|
||||
})
|
||||
}
|
||||
|
||||
/// Fragments de texte consécutifs regroupés — `parityMerge` du Go.
|
||||
fn merge(evs: Vec<Value>) -> Vec<Value> {
|
||||
let mut out: Vec<Value> = Vec::new();
|
||||
for e in evs {
|
||||
if let Some(last) = out.last_mut() {
|
||||
let (lo, eo) = (last.as_object().unwrap(), e.as_object().unwrap());
|
||||
if lo.len() == 1 && eo.len() == 1 {
|
||||
let k = ["content", "reasoning"].into_iter().find(|k| {
|
||||
lo.get(*k).is_some_and(Value::is_string)
|
||||
&& eo.get(*k).is_some_and(Value::is_string)
|
||||
});
|
||||
if let Some(k) = k {
|
||||
let s = format!("{}{}", lo[k].as_str().unwrap(), eo[k].as_str().unwrap());
|
||||
*last = json!({ k: s });
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
out.push(e);
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
async fn replay(fx: Fixture) -> Result<(), String> {
|
||||
let cfg = fx.cfg;
|
||||
let refusals = EchoRefusals::default();
|
||||
let echo = echo_policy_for(&cfg, &refusals, None);
|
||||
let tc = TurnConfig {
|
||||
ep: resolve_chat_endpoint(&cfg, ""),
|
||||
tools: fx.tools,
|
||||
temperature: fx.temperature,
|
||||
code: false,
|
||||
reasoning: turn_reasoning(&cfg, &EffortFallbacks::default()),
|
||||
compact: CompactConfig::from_config(&cfg, echo.clone()),
|
||||
echo,
|
||||
patterns: RetryPatterns::builtin(),
|
||||
cfg,
|
||||
};
|
||||
let host = ParityHost {
|
||||
replies: Mutex::new(fx.replies.into()),
|
||||
tool_results: fx.tool_results,
|
||||
requests: Mutex::new(Vec::new()),
|
||||
};
|
||||
let evs = Arc::new(Mutex::new(Vec::new()));
|
||||
let sink = evs.clone();
|
||||
let res = run_turn(&host, &tc, fx.messages, &Cancel::never(), &mut |ev| {
|
||||
if let Some(e) = event(&ev) {
|
||||
sink.lock().unwrap().push(e);
|
||||
}
|
||||
true
|
||||
})
|
||||
.await;
|
||||
|
||||
let mut diffs = Vec::new();
|
||||
let requests = host.requests.into_inner().unwrap();
|
||||
if requests.len() != fx.expect.requests.len() {
|
||||
diffs.push(format!(
|
||||
"requêtes : {} envoyée(s), {} attendue(s)",
|
||||
requests.len(),
|
||||
fx.expect.requests.len()
|
||||
));
|
||||
}
|
||||
for (i, (got, want)) in requests.iter().zip(&fx.expect.requests).enumerate() {
|
||||
if got != want {
|
||||
diffs.push(format!(
|
||||
"requête {} :\n obtenu {}\n attendu {}",
|
||||
i + 1,
|
||||
got,
|
||||
want
|
||||
));
|
||||
}
|
||||
}
|
||||
let events = merge(std::mem::take(&mut *evs.lock().unwrap()));
|
||||
if events != fx.expect.events {
|
||||
diffs.push(format!(
|
||||
"événements :\n obtenu {}\n attendu {}",
|
||||
Value::Array(events),
|
||||
Value::Array(fx.expect.events)
|
||||
));
|
||||
}
|
||||
let extra = serde_json::to_value(&res.extra).unwrap();
|
||||
if extra != fx.expect.extra {
|
||||
diffs.push(format!(
|
||||
"historique :\n obtenu {extra}\n attendu {}",
|
||||
fx.expect.extra
|
||||
));
|
||||
}
|
||||
let err = res.err.unwrap_or_default();
|
||||
if err != fx.expect.err {
|
||||
diffs.push(format!("erreur : {err:?}, attendu {:?}", fx.expect.err));
|
||||
}
|
||||
if diffs.is_empty() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(format!("{} :\n{}", fx.name, diffs.join("\n")))
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn journaux_du_go() {
|
||||
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/parity");
|
||||
let mut paths: Vec<PathBuf> = std::fs::read_dir(&dir)
|
||||
.expect("tests/parity")
|
||||
.map(|e| e.unwrap().path())
|
||||
.filter(|p| p.extension().is_some_and(|x| x == "json"))
|
||||
.collect();
|
||||
paths.sort();
|
||||
assert!(!paths.is_empty(), "aucun journal de référence");
|
||||
let mut failures = Vec::new();
|
||||
for p in &paths {
|
||||
let fx: Fixture = serde_json::from_slice(&std::fs::read(p).unwrap())
|
||||
.unwrap_or_else(|e| panic!("{} illisible : {e}", p.display()));
|
||||
if let Err(e) = replay(fx).await {
|
||||
failures.push(e);
|
||||
}
|
||||
}
|
||||
assert!(
|
||||
failures.is_empty(),
|
||||
"{} scénario(s) sur {} divergent du Go :\n\n{}",
|
||||
failures.len(),
|
||||
paths.len(),
|
||||
failures.join("\n\n")
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,309 @@
|
||||
{
|
||||
"name": "api_externe",
|
||||
"cfg": {
|
||||
"EXTERNAL": "1",
|
||||
"EXTERNAL_MODEL": "gpt-x",
|
||||
"EXTERNAL_URL": "{{URL}}"
|
||||
},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Lis a.txt"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"reasoning_content\":\"Je lis.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{\"tool_calls\":[{\"function\":{\"arguments\":\"{\\\"file\\\":\\\"a.txt\\\"}\",\"name\":\"read\"},\"id\":\"c1\",\"index\":0,\"type\":\"function\"}]}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"tool_calls\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Deux lignes.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Lis a.txt",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "gpt-x",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Lis a.txt",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"file\":\"a.txt\"}",
|
||||
"name": "read"
|
||||
},
|
||||
"id": "c1",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "ligne 1\nligne 2",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c1"
|
||||
}
|
||||
],
|
||||
"model": "gpt-x",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"reasoning": "Je lis."
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "a.txt",
|
||||
"name": "read",
|
||||
"typing": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "a.txt",
|
||||
"name": "read"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"done": true,
|
||||
"label": "a.txt",
|
||||
"name": "read",
|
||||
"result": "ligne 1\nligne 2",
|
||||
"result_chars": 15
|
||||
}
|
||||
},
|
||||
{
|
||||
"content": "Deux lignes."
|
||||
}
|
||||
],
|
||||
"extra": [
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"id": "c1",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"arguments": "{\"file\":\"a.txt\"}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "ligne 1\nligne 2",
|
||||
"tool_call_id": "c1"
|
||||
}
|
||||
],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,456 @@
|
||||
{
|
||||
"name": "appel_repete",
|
||||
"cfg": {},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Lis a.txt"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"tool_calls\":[{\"function\":{\"arguments\":\"{\\\"file\\\":\\\"a.txt\\\"}\",\"name\":\"read\"},\"id\":\"c1\",\"index\":0,\"type\":\"function\"}]}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"tool_calls\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"tool_calls\":[{\"function\":{\"arguments\":\"{\\\"file\\\":\\\"a.txt\\\"}\",\"name\":\"read\"},\"id\":\"c2\",\"index\":0,\"type\":\"function\"}]}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"tool_calls\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Toujours deux lignes.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Lis a.txt",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Lis a.txt",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"file\":\"a.txt\"}",
|
||||
"name": "read"
|
||||
},
|
||||
"id": "c1",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "ligne 1\nligne 2",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c1"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Lis a.txt",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"file\":\"a.txt\"}",
|
||||
"name": "read"
|
||||
},
|
||||
"id": "c1",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "ligne 1\nligne 2",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c1"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"file\":\"a.txt\"}",
|
||||
"name": "read"
|
||||
},
|
||||
"id": "c2",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "[déjà fait] Appel identique déjà exécuté dans ce tour — non rejoué. Voici à nouveau son résultat ; ne le redemande pas une troisième fois.\n\nligne 1\nligne 2",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c2"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "a.txt",
|
||||
"name": "read",
|
||||
"typing": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "a.txt",
|
||||
"name": "read"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"done": true,
|
||||
"label": "a.txt",
|
||||
"name": "read",
|
||||
"result": "ligne 1\nligne 2",
|
||||
"result_chars": 15
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "a.txt",
|
||||
"name": "read",
|
||||
"typing": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "a.txt",
|
||||
"name": "read"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"done": true,
|
||||
"label": "a.txt",
|
||||
"name": "read",
|
||||
"result": "[déjà fait] Appel identique déjà exécuté dans ce tour — non rejoué. Voici à nouveau son résultat ; ne le redemande pas une troisième fois.\n\nligne 1\nligne 2",
|
||||
"result_chars": 155
|
||||
}
|
||||
},
|
||||
{
|
||||
"content": "Toujours deux lignes."
|
||||
}
|
||||
],
|
||||
"extra": [
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"id": "c1",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"arguments": "{\"file\":\"a.txt\"}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "ligne 1\nligne 2",
|
||||
"tool_call_id": "c1"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"id": "c2",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"arguments": "{\"file\":\"a.txt\"}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "[déjà fait] Appel identique déjà exécuté dans ce tour — non rejoué. Voici à nouveau son résultat ; ne le redemande pas une troisième fois.\n\nligne 1\nligne 2",
|
||||
"tool_call_id": "c2"
|
||||
}
|
||||
],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,407 @@
|
||||
{
|
||||
"name": "appel_textuel",
|
||||
"cfg": {},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Lis a.txt"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"\\u003ctool_call\\u003e{\\\"name\\\":\\\"read\\\",\\\"arguments\\\":{\\\"file\\\":\\\"a.txt\\\"}}\\u003c/tool_call\\u003e\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"tool_calls\":[{\"function\":{\"arguments\":\"{\\\"file\\\":\\\"a.txt\\\"}\",\"name\":\"read\"},\"id\":\"c1\",\"index\":0,\"type\":\"function\"}]}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"tool_calls\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Deux lignes.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Lis a.txt",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Lis a.txt",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"content": "<tool_call>{\"name\":\"read\",\"arguments\":{\"file\":\"a.txt\"}}</tool_call>",
|
||||
"role": "assistant"
|
||||
},
|
||||
{
|
||||
"content": "Your last answer contained a TOOL CALL WRITTEN AS TEXT — it was never executed:\n<tool_call>{\"name\":\"read\",\"arguments\":{\"file\":\"a.txt\"}}</tool_call>\nTool calls must go through the tool-call protocol, never in the answer text. Redo it now: emit the real tool call, or answer directly without pretending to call a tool.",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Lis a.txt",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"content": "<tool_call>{\"name\":\"read\",\"arguments\":{\"file\":\"a.txt\"}}</tool_call>",
|
||||
"role": "assistant"
|
||||
},
|
||||
{
|
||||
"content": "Your last answer contained a TOOL CALL WRITTEN AS TEXT — it was never executed:\n<tool_call>{\"name\":\"read\",\"arguments\":{\"file\":\"a.txt\"}}</tool_call>\nTool calls must go through the tool-call protocol, never in the answer text. Redo it now: emit the real tool call, or answer directly without pretending to call a tool.",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"file\":\"a.txt\"}",
|
||||
"name": "read"
|
||||
},
|
||||
"id": "c1",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "ligne 1\nligne 2",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c1"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"content": "<tool_call>{\"name\":\"read\",\"arguments\":{\"file\":\"a.txt\"}}</tool_call>"
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "a.txt",
|
||||
"name": "read",
|
||||
"typing": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "a.txt",
|
||||
"name": "read"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"done": true,
|
||||
"label": "a.txt",
|
||||
"name": "read",
|
||||
"result": "ligne 1\nligne 2",
|
||||
"result_chars": 15
|
||||
}
|
||||
},
|
||||
{
|
||||
"content": "Deux lignes."
|
||||
}
|
||||
],
|
||||
"extra": [
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "<tool_call>{\"name\":\"read\",\"arguments\":{\"file\":\"a.txt\"}}</tool_call>"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Your last answer contained a TOOL CALL WRITTEN AS TEXT — it was never executed:\n<tool_call>{\"name\":\"read\",\"arguments\":{\"file\":\"a.txt\"}}</tool_call>\nTool calls must go through the tool-call protocol, never in the answer text. Redo it now: emit the real tool call, or answer directly without pretending to call a tool."
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"id": "c1",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"arguments": "{\"file\":\"a.txt\"}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "ligne 1\nligne 2",
|
||||
"tool_call_id": "c1"
|
||||
}
|
||||
],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
{
|
||||
"name": "arguments_illisibles",
|
||||
"cfg": {},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Lis a.txt"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"tool_calls\":[{\"function\":{\"arguments\":\"{\\\"file\\\":\",\"name\":\"read\"},\"id\":\"c1\",\"index\":0,\"type\":\"function\"}]}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"tool_calls\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Pardon.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Lis a.txt",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Lis a.txt",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{}",
|
||||
"name": "read"
|
||||
},
|
||||
"id": "c1",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "[erreur] arguments de l'appel illisibles (JSON invalide ou tronqué) : l'outil n'a PAS été exécuté. Renvoie l'appel avec des arguments JSON complets et valides.",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c1"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"tool_used": {
|
||||
"name": "read"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"done": true,
|
||||
"name": "read",
|
||||
"result": "[erreur] arguments de l'appel illisibles (JSON invalide ou tronqué) : l'outil n'a PAS été exécuté. Renvoie l'appel avec des arguments JSON complets et valides.",
|
||||
"result_chars": 159
|
||||
}
|
||||
},
|
||||
{
|
||||
"content": "Pardon."
|
||||
}
|
||||
],
|
||||
"extra": [
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"id": "c1",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"arguments": "{}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "[erreur] arguments de l'appel illisibles (JSON invalide ou tronqué) : l'outil n'a PAS été exécuté. Renvoie l'appel avec des arguments JSON complets et valides.",
|
||||
"tool_call_id": "c1"
|
||||
}
|
||||
],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,643 @@
|
||||
{
|
||||
"name": "budget_depasse",
|
||||
"cfg": {
|
||||
"AGENT_BUDGET": "2"
|
||||
},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Explore"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"tool_calls\":[{\"function\":{\"arguments\":\"{\\\"command\\\":\\\"ls 1\\\"}\",\"name\":\"bash\"},\"id\":\"c1\",\"index\":0,\"type\":\"function\"}]}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"tool_calls\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"tool_calls\":[{\"function\":{\"arguments\":\"{\\\"command\\\":\\\"ls 2\\\"}\",\"name\":\"bash\"},\"id\":\"c2\",\"index\":0,\"type\":\"function\"}]}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"tool_calls\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"tool_calls\":[{\"function\":{\"arguments\":\"{\\\"command\\\":\\\"ls 3\\\"}\",\"name\":\"bash\"},\"id\":\"c3\",\"index\":0,\"type\":\"function\"}]}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"tool_calls\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"J'arrête là.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Explore",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Explore",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"command\":\"ls 1\"}",
|
||||
"name": "bash"
|
||||
},
|
||||
"id": "c1",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "a.txt\nb.txt",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c1"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Explore",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"command\":\"ls 1\"}",
|
||||
"name": "bash"
|
||||
},
|
||||
"id": "c1",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "a.txt\nb.txt",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c1"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"command\":\"ls 2\"}",
|
||||
"name": "bash"
|
||||
},
|
||||
"id": "c2",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "a.txt\nb.txt",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c2"
|
||||
},
|
||||
{
|
||||
"content": "[system] You have made 2 tool calls in this single turn. That is a lot: you almost certainly have enough to answer already. Stop exploring and write your final answer now, unless exactly one specific call is genuinely still missing.",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Explore",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"command\":\"ls 1\"}",
|
||||
"name": "bash"
|
||||
},
|
||||
"id": "c1",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "a.txt\nb.txt",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c1"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"command\":\"ls 2\"}",
|
||||
"name": "bash"
|
||||
},
|
||||
"id": "c2",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "a.txt\nb.txt",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c2"
|
||||
},
|
||||
{
|
||||
"content": "[system] You have made 2 tool calls in this single turn. That is a lot: you almost certainly have enough to answer already. Stop exploring and write your final answer now, unless exactly one specific call is genuinely still missing.",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"command\":\"ls 3\"}",
|
||||
"name": "bash"
|
||||
},
|
||||
"id": "c3",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "a.txt\nb.txt",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c3"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "ls 1",
|
||||
"name": "bash",
|
||||
"typing": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "ls 1",
|
||||
"name": "bash"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"done": true,
|
||||
"label": "ls 1",
|
||||
"name": "bash",
|
||||
"result": "a.txt\nb.txt",
|
||||
"result_chars": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "ls 2",
|
||||
"name": "bash",
|
||||
"typing": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "ls 2",
|
||||
"name": "bash"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"done": true,
|
||||
"label": "ls 2",
|
||||
"name": "bash",
|
||||
"result": "a.txt\nb.txt",
|
||||
"result_chars": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "ls 3",
|
||||
"name": "bash",
|
||||
"typing": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "ls 3",
|
||||
"name": "bash"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"done": true,
|
||||
"label": "ls 3",
|
||||
"name": "bash",
|
||||
"result": "a.txt\nb.txt",
|
||||
"result_chars": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"content": "J'arrête là."
|
||||
}
|
||||
],
|
||||
"extra": [
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"id": "c1",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"arguments": "{\"command\":\"ls 1\"}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "a.txt\nb.txt",
|
||||
"tool_call_id": "c1"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"id": "c2",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"arguments": "{\"command\":\"ls 2\"}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "a.txt\nb.txt",
|
||||
"tool_call_id": "c2"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "[system] You have made 2 tool calls in this single turn. That is a lot: you almost certainly have enough to answer already. Stop exploring and write your final answer now, unless exactly one specific call is genuinely still missing."
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"id": "c3",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"arguments": "{\"command\":\"ls 3\"}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "a.txt\nb.txt",
|
||||
"tool_call_id": "c3"
|
||||
}
|
||||
],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,343 @@
|
||||
{
|
||||
"name": "deux_outils_en_parallele",
|
||||
"cfg": {},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Liste puis lis"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"tool_calls\":[{\"function\":{\"arguments\":\"{\\\"command\\\":\\\"ls\\\"}\",\"name\":\"bash\"},\"id\":\"c1\",\"index\":0,\"type\":\"function\"}]}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{\"tool_calls\":[{\"function\":{\"arguments\":\"{\\\"file\\\":\\\"a.txt\\\"}\",\"name\":\"read\"},\"id\":\"c2\",\"index\":1,\"type\":\"function\"}]}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"tool_calls\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Fait.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Liste puis lis",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Liste puis lis",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"command\":\"ls\"}",
|
||||
"name": "bash"
|
||||
},
|
||||
"id": "c1",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"file\":\"a.txt\"}",
|
||||
"name": "read"
|
||||
},
|
||||
"id": "c2",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "a.txt\nb.txt",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c1"
|
||||
},
|
||||
{
|
||||
"content": "ligne 1\nligne 2",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c2"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "ls",
|
||||
"name": "bash",
|
||||
"typing": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "ls",
|
||||
"name": "bash"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"done": true,
|
||||
"label": "ls",
|
||||
"name": "bash",
|
||||
"result": "a.txt\nb.txt",
|
||||
"result_chars": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "a.txt",
|
||||
"name": "read"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"done": true,
|
||||
"label": "a.txt",
|
||||
"name": "read",
|
||||
"result": "ligne 1\nligne 2",
|
||||
"result_chars": 15
|
||||
}
|
||||
},
|
||||
{
|
||||
"content": "Fait."
|
||||
}
|
||||
],
|
||||
"extra": [
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"id": "c1",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"arguments": "{\"command\":\"ls\"}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "c2",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"arguments": "{\"file\":\"a.txt\"}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "a.txt\nb.txt",
|
||||
"tool_call_id": "c1"
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "ligne 1\nligne 2",
|
||||
"tool_call_id": "c2"
|
||||
}
|
||||
],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
{
|
||||
"name": "echantillonnage_et_effort",
|
||||
"cfg": {
|
||||
"REASONING_EFFORT": "low",
|
||||
"TOP_K": "40",
|
||||
"TOP_P": "0.9"
|
||||
},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Salut"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Bonjour.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"chat_template_kwargs": {
|
||||
"reasoning_effort": "low"
|
||||
},
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Salut",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"reasoning_effort": "low",
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"top_k": 40,
|
||||
"top_p": 0.9
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"content": "Bonjour."
|
||||
}
|
||||
],
|
||||
"extra": [],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,241 @@
|
||||
{
|
||||
"name": "erreur_500_avec_outils",
|
||||
"cfg": {},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Bonjour"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 500,
|
||||
"lines": [
|
||||
"{\"error\":{\"code\":500,\"message\":\"Failed to parse tool call\",\"type\":\"server_error\"}}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Salut.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Bonjour",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Bonjour\n\n[system] Do not call any more tools. Answer now, directly, in the user's language, using only the information already gathered.",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tool_choice": "none",
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"content": "Salut."
|
||||
}
|
||||
],
|
||||
"extra": [],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
{
|
||||
"name": "erreur_500_deux_fois",
|
||||
"cfg": {},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Bonjour"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 500,
|
||||
"lines": [
|
||||
"{\"error\":{\"code\":500,\"message\":\"Failed to parse tool call\",\"type\":\"server_error\"}}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 500,
|
||||
"lines": [
|
||||
"{\"error\":{\"code\":500,\"message\":\"Failed to parse tool call\",\"type\":\"server_error\"}}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Salut.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Bonjour",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Bonjour\n\n[system] Do not call any more tools. Answer now, directly, in the user's language, using only the information already gathered.",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tool_choice": "none",
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.\n\nDo not call any more tools. Answer now, directly, in the user's language, using only the information already gathered.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Bonjour",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"content": "Salut."
|
||||
}
|
||||
],
|
||||
"extra": [],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
{
|
||||
"name": "erreur_moteur",
|
||||
"cfg": {},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Bonjour"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 400,
|
||||
"lines": [
|
||||
"{\"error\":{\"code\":400,\"message\":\"requête invalide\",\"type\":\"invalid_request_error\"}}"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Bonjour",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"err": "llama-server a renvoyé 400 : {\"error\":{\"code\":400,\"message\":\"requête invalide\",\"type\":\"invalid_request_error\"}}"
|
||||
}
|
||||
],
|
||||
"extra": [],
|
||||
"err": "llama-server a renvoyé 400 : {\"error\":{\"code\":400,\"message\":\"requête invalide\",\"type\":\"invalid_request_error\"}}"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,379 @@
|
||||
{
|
||||
"name": "historique_avec_outils",
|
||||
"cfg": {},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Lis a.txt"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"id": "c0",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"arguments": "{\"file\":\"a.txt\"}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "ligne 1",
|
||||
"tool_call_id": "c0"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "Une ligne."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Et b.txt ?"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"tool_calls\":[{\"function\":{\"arguments\":\"{\\\"file\\\":\\\"b.txt\\\"}\",\"name\":\"read\"},\"id\":\"c1\",\"index\":0,\"type\":\"function\"}]}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"tool_calls\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Deux lignes.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Lis a.txt",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"file\":\"a.txt\"}",
|
||||
"name": "read"
|
||||
},
|
||||
"id": "c0",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "ligne 1",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c0"
|
||||
},
|
||||
{
|
||||
"content": "Une ligne.",
|
||||
"role": "assistant"
|
||||
},
|
||||
{
|
||||
"content": "Et b.txt ?",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Lis a.txt",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"file\":\"a.txt\"}",
|
||||
"name": "read"
|
||||
},
|
||||
"id": "c0",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "ligne 1",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c0"
|
||||
},
|
||||
{
|
||||
"content": "Une ligne.",
|
||||
"role": "assistant"
|
||||
},
|
||||
{
|
||||
"content": "Et b.txt ?",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"file\":\"b.txt\"}",
|
||||
"name": "read"
|
||||
},
|
||||
"id": "c1",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "ligne 1\nligne 2",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c1"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "b.txt",
|
||||
"name": "read",
|
||||
"typing": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "b.txt",
|
||||
"name": "read"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"done": true,
|
||||
"label": "b.txt",
|
||||
"name": "read",
|
||||
"result": "ligne 1\nligne 2",
|
||||
"result_chars": 15
|
||||
}
|
||||
},
|
||||
{
|
||||
"content": "Deux lignes."
|
||||
}
|
||||
],
|
||||
"extra": [
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"id": "c1",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"arguments": "{\"file\":\"b.txt\"}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "ligne 1\nligne 2",
|
||||
"tool_call_id": "c1"
|
||||
}
|
||||
],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
{
|
||||
"name": "outil_inconnu",
|
||||
"cfg": {},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Fais-le"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"tool_calls\":[{\"function\":{\"arguments\":\"{}\",\"name\":\"voler\"},\"id\":\"c1\",\"index\":0,\"type\":\"function\"}]}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"tool_calls\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Impossible.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Fais-le",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Fais-le",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{}",
|
||||
"name": "voler"
|
||||
},
|
||||
"id": "c1",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "[erreur] outil inconnu : voler",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c1"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"tool_used": {
|
||||
"name": "voler"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"done": true,
|
||||
"name": "voler",
|
||||
"result": "[erreur] outil inconnu : voler",
|
||||
"result_chars": 30
|
||||
}
|
||||
},
|
||||
{
|
||||
"content": "Impossible."
|
||||
}
|
||||
],
|
||||
"extra": [
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"id": "c1",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "voler",
|
||||
"arguments": "{}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "[erreur] outil inconnu : voler",
|
||||
"tool_call_id": "c1"
|
||||
}
|
||||
],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,301 @@
|
||||
{
|
||||
"name": "outil_puis_reponse",
|
||||
"cfg": {},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Lis a.txt"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"tool_calls\":[{\"function\":{\"arguments\":\"{\\\"file\\\":\\\"a.txt\\\"}\",\"name\":\"read\"},\"id\":\"c1\",\"index\":0,\"type\":\"function\"}]}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"tool_calls\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Le fichier a deux lignes.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Lis a.txt",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Lis a.txt",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"file\":\"a.txt\"}",
|
||||
"name": "read"
|
||||
},
|
||||
"id": "c1",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "ligne 1\nligne 2",
|
||||
"role": "tool",
|
||||
"tool_call_id": "c1"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "a.txt",
|
||||
"name": "read",
|
||||
"typing": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"label": "a.txt",
|
||||
"name": "read"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tool_used": {
|
||||
"done": true,
|
||||
"label": "a.txt",
|
||||
"name": "read",
|
||||
"result": "ligne 1\nligne 2",
|
||||
"result_chars": 15
|
||||
}
|
||||
},
|
||||
{
|
||||
"content": "Le fichier a deux lignes."
|
||||
}
|
||||
],
|
||||
"extra": [
|
||||
{
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
{
|
||||
"id": "c1",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"arguments": "{\"file\":\"a.txt\"}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "ligne 1\nligne 2",
|
||||
"tool_call_id": "c1"
|
||||
}
|
||||
],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,252 @@
|
||||
{
|
||||
"name": "pense_sans_agir",
|
||||
"cfg": {},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Cherche"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"reasoning_content\":\"Il faudrait lister les fichiers.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Voilà.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Cherche",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Cherche",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"content": "You reasoned but did not call a tool or answer. Act NOW: call the appropriate tool directly (e.g. mem_search/mem_read/bash), or give your final answer if you already have the info. Don't explain, act.",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"reasoning": "Il faudrait lister les fichiers."
|
||||
},
|
||||
{
|
||||
"drop_reasoning": true
|
||||
},
|
||||
{
|
||||
"content": "Voilà."
|
||||
}
|
||||
],
|
||||
"extra": [],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,345 @@
|
||||
{
|
||||
"name": "pense_sans_agir_deux_fois",
|
||||
"cfg": {},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Cherche"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"reasoning_content\":\"Lister les fichiers.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"reasoning_content\":\"Toujours lister.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Voilà.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Cherche",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Cherche",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"content": "You reasoned but did not call a tool or answer. Act NOW: call the appropriate tool directly (e.g. mem_search/mem_read/bash), or give your final answer if you already have the info. Don't explain, act.",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Cherche",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"content": "You reasoned but did not call a tool or answer. Act NOW: call the appropriate tool directly (e.g. mem_search/mem_read/bash), or give your final answer if you already have the info. Don't explain, act.",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"content": "You are stuck re-describing the same plan without executing it. Stop reasoning. In your NEXT message, either call ONE tool right now, or write your final answer in plain text using only what you already know — no more planning, no more thinking, act or answer this instant.",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"reasoning": "Lister les fichiers."
|
||||
},
|
||||
{
|
||||
"drop_reasoning": true
|
||||
},
|
||||
{
|
||||
"reasoning": "Toujours lister."
|
||||
},
|
||||
{
|
||||
"drop_reasoning": true
|
||||
},
|
||||
{
|
||||
"content": "Voilà."
|
||||
}
|
||||
],
|
||||
"extra": [],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
{
|
||||
"name": "pensee_en_ligne",
|
||||
"cfg": {
|
||||
"REASONING": "on"
|
||||
},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Salut"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"\\u003cthink\\u003eIl dit bonjour.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"\\u003c/think\\u003eBonjour !\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Salut",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"content": "<think>Il dit b"
|
||||
},
|
||||
{
|
||||
"reasoning": "onjour."
|
||||
},
|
||||
{
|
||||
"content": "Bonjour !"
|
||||
}
|
||||
],
|
||||
"extra": [],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
{
|
||||
"name": "raisonnement_coupe",
|
||||
"cfg": {
|
||||
"REASONING": "off"
|
||||
},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Salut"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Bonjour.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"chat_template_kwargs": {
|
||||
"enable_thinking": false
|
||||
},
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Salut",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"content": "Bonjour."
|
||||
}
|
||||
],
|
||||
"extra": [],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
{
|
||||
"name": "raisonnement_puis_reponse",
|
||||
"cfg": {},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Combien font 2+2 ?"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"reasoning_content\":\"Je calcule.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{\"reasoning_content\":\" 4.\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"4\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Combien font 2+2 ?",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"reasoning": "Je calcule. 4."
|
||||
},
|
||||
{
|
||||
"content": "4"
|
||||
}
|
||||
],
|
||||
"extra": [],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
{
|
||||
"name": "reponse_simple",
|
||||
"cfg": {},
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "Tu es Loki."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Bonjour"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read",
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "bash",
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature": 0.7,
|
||||
"replies": [
|
||||
{
|
||||
"status": 200,
|
||||
"lines": [
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"Bon\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{\"content\":\"jour !\"}}]}",
|
||||
"data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":100}}",
|
||||
"data: [DONE]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tool_results": {
|
||||
"bash": "a.txt\nb.txt",
|
||||
"read": "ligne 1\nligne 2"
|
||||
},
|
||||
"expect": {
|
||||
"requests": [
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"content": "Tu es Loki.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "Bonjour",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "loki",
|
||||
"parallel_tool_calls": false,
|
||||
"stream": true,
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"temperature": 0.7,
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Read a file with 1-indexed line numbers (offset/limit for long files). ALWAYS use this instead of cat/type: output is bounded and reading a file is REQUIRED before you may edit or overwrite it.",
|
||||
"name": "read",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path (relative to the working folder)",
|
||||
"type": "string"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Lines (default 400, max 1000)",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"description": "Start line (default 1)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"function": {
|
||||
"description": "Run a shell command (bash syntax) and return stdout, stderr and exit code: inspect the system, read files and logs, run scripts. To CREATE or REWRITE a file use write instead — never echo/cat/python -c. Avoid destructive commands unless asked.",
|
||||
"name": "bash",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "The command",
|
||||
"type": "string"
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Timeout s (default 30, max 300)",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"content": "Bonjour !"
|
||||
}
|
||||
],
|
||||
"extra": [],
|
||||
"err": ""
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user