From c57aee6fba4f78efe1fdc24c0720479223f80f72 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Mon, 20 Nov 2023 10:10:42 -0800 Subject: [PATCH 1/2] Update examples/typescript-functioncalling/readme.md Co-authored-by: Bruce MacDonald --- examples/typescript-functioncalling/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/typescript-functioncalling/readme.md b/examples/typescript-functioncalling/readme.md index d0ab3671..38e649dd 100644 --- a/examples/typescript-functioncalling/readme.md +++ b/examples/typescript-functioncalling/readme.md @@ -2,7 +2,7 @@ ![function calling 2023-11-16 16_12_58](https://github.com/jmorganca/ollama/assets/633681/a0acc247-9746-45ab-b325-b65dfbbee4fb) -One of the most exciting features added to Large Language Models recently is 'function calling'. It's a bit of a confusing name. It's understandable if you think that means the model can call functions, but that's not what it means. Function Calling simply means that the output of the model is formatted in JSON, using a preconfigured schema, and uses the expected types. Then your code can use the output of the model and call functions with it. +One of the most exciting features added to Large Language Models recently is 'function calling'. It's a bit of a confusing name. It's understandable if you think that means the model can call functions, but that's not what it means. Function calling simply means that the output of the model is formatted in JSON, using a preconfigured schema, and uses the expected types. Then your code can use the output of the model and call functions with it. The two examples provided can extract information out of the provided texts. The first example uses the first couple of chapters from War and Peace by Lev Nikolayevich Tolstoy, and extracts the names and titles of the characters introduced in the story. The second example uses a more complicated schema to pull out addresses and event information from a series of emails. From 48896f626cf5b357f65e7e1e1dcad2d3c2efced5 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Mon, 20 Nov 2023 10:12:10 -0800 Subject: [PATCH 2/2] Update examples/typescript-functioncalling/extractwp.ts Co-authored-by: Bruce MacDonald --- examples/typescript-functioncalling/extractwp.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/typescript-functioncalling/extractwp.ts b/examples/typescript-functioncalling/extractwp.ts index 21e77b48..b199607d 100644 --- a/examples/typescript-functioncalling/extractwp.ts +++ b/examples/typescript-functioncalling/extractwp.ts @@ -21,7 +21,7 @@ async function main() { }], } - // Depending on the model chosen, you may have a restricted context. + // Depending on the model chosen, you may be limited by the size of the context window, so limit the context to 2000 words. const textcontent = await readFile("./wp.txt", "utf-8").then((text) => text.split(" ").slice(0, 2000).join(" ")); // Specific instructions for this task