Comments (1)
With Ollama, you need to specify how you go from text output to tools. There are some examples here: https://github.com/lgrammel/modelfusion/tree/main/examples/basic/src/model-provider/ollama
E.g.:
const { tool, args, toolCall, result } = await useTool(
ollama
.CompletionTextGenerator({
model: "mistral",
promptTemplate: ollama.prompt.Mistral,
raw: true, // required when using custom prompt template
format: "json",
temperature: 0,
stopSequences: ["\n\n"], // prevent infinite generation
})
.withInstructionPrompt()
.asToolCallGenerationModel(jsonToolCallPrompt.text()),
new MathJsTool({ name: "calculator" }),
"What's fourteen times twelve?"
);
console.log(`Tool call`, toolCall);
console.log(`Tool: ${tool}`);
console.log(`Arguments: ${JSON.stringify(args)}`);
console.log(`Result: ${result}`);
That being said, chat w/ tools is not supported yet w/ Ollama, and the interface for creating tool models might change.
from modelfusion.
Related Issues (20)
- Caching fails on subsequent invocations HOT 3
- Cohere custom model and chat api support
- TurboPuff Vector DB support
- Postgres/Knex Vector DB support with pgvector HOT 1
- Perplexity LLM exploration and docs page (OpenAI compatible should work) - they have online LLMs which are cool
- LocalAI exploration & docs page (OpenAI)
- Fireworks / Anyscale / Together docs pages (for their API configs)
- Google Gemini exploration HOT 3
- Add OpenChat prompt template
- introduce classify model function
- explore img + text -> image models / prompts
- move out openai cost calc from modelfusion and modelfusion/experimental into a standalone pkg that can also be used w/o modelfusion
- explore if there is a good local TTS that could be integrated
- explore variable output parsers, e.g. for list (when generated using GBNF grammar)
- BUG: Ollama response `prompt_eval_count` is required field. HOT 1
- can't connect to https://api.openai.com:443/v1/audio/transcriptions HOT 4
- First parameter has member `readable` when running generate text on AWS Lambda. HOT 3
- experimental-vm-modules bug introduced in v0.134.0 HOT 7
- Ollama Mistral .withPromptTemplate Error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modelfusion.