isamu / graphai

0 stars 0 forks source link

nestしたinputs #50

Open isamu opened 1 week ago

isamu commented 1 week ago
         nextHistory: {
            agent: "arrayFlatAgent",
            isResult: true,
            inputs: {
              array: [
                ":history",
                [
                  {"role": "user", "content": ":message"}
                ],
                [
                  {"role": "assistant", "content": ":task1.choices.$0.message.content"}
                ]
              ],
            }
          },

こういうのをやりたかったけど、深い部分のsourceはサポートしていないようでした。

isamu commented 1 week ago

現状でも組み合わせで対応できる

      messageData: {
        agent: "stringTemplateAgent",
        inputs: [":ideaPrompt", ":task1.choices.$0.message.content"],
        params: {
          template: [
            { role: "user", content: "${0}" },
            { role: "assistant", content: "${1}" },
          ],
        },
      },
      nextHistory: {
        agent: "arrayFlatAgent",
        inputs: {
          array: [":history", ":messageData"],
        },
      },