Comments (6)
I totally agree. This is another one of the things handled by the lib I use for request/response formatting. Specifically, this happens here:
https://github.com/transitive-bullshit/chatgpt-api/blob/main/src/chatgpt-api.ts#L395
Maybe it's time to roll my own solution for this, so that a prompt formatting can be explicitly defined. I'd like to implement this, but need some time to think about how best to do so.
from wingman.
I studied this library recently when trying to implement OpenAi support in my server project. It is easy to replace: example code:
- With the library
- Without the library: using just the eventsource-parser library (used internaly in the chatgpt api lib)
from wingman.
yes it looks good. I would define a template in a very simple maner. An Alpaca one:
const template = `{system}
### Instruction: fix this invalid json:
'''json
{prompt}
'''
### Response: (answer in valid json)
`
const system = "You are a javascript code specialist. Below is an instruction that describes a task. Write a response that appropriately completes the request";
const _prompt = '{"a": 1,}';
const finalPrompt = template.replace("{system}", system).replace("{prompt}", _prompt)
where {system}
is actually covered by systemMessageTemplate
in Wingman
from wingman.
Nice, seems easy enough. I should have time to get this done this evening.
How would you expect to define a template? I think I'd probably surface this as an item in the wingman settings panel as e.g. wingman.openai.template
, as well as allow it to be overridden by any given command. Does that seem okay to you?
from wingman.
Note about handling the sse request: the eventsource-parser lib is not really necessary: we can handle this manually using a regex, this is what I did in my frontend: example
from wingman.
About templates I just started a little library to manage them more efficiently an use prebuilt template formats: https://github.com/synw/modprompt
I got tired to copy and change text to different template formats depending on the models, so I wrote this to ease the process of using templates in Typescript. It might be useful for Wingman as well
from wingman.
Related Issues (20)
- Support configurable inference params per prompt HOT 8
- Context window and max_tokens management
- Disable the copy icon when generating HOT 1
- Write function comment prompt: ask before injecting the response into the file HOT 1
- New Goinfer provider HOT 3
- New Koboldcpp provider HOT 10
- Great Job! HOT 1
- A new theme sharing HOT 1
- Please include the julia language (.jl) extension also. HOT 1
- Wingman v2.0.8 , Local model is not supporting HOT 4
- Using the new version with local open source backends HOT 5
- Discussion: modelfusion HOT 2
- Missing Implementation of 'file' Placeholder as Mentioned in README HOT 1
- Feature Request: Enhance Contextual Understanding by Allowing Code File Integration
- Feature Request: Integration of Azure OpenAI Credentials Support HOT 1
- The selected code is forcibly replaced. HOT 4
- Model Installed in VS Code but No Settings No Logo in Sidebar Menu HOT 8
- `Error: Failed to open completion stream: 429 Too Many Requests` HOT 2
- Feature Request: Support Anthropic messages API
- Remove restriction on Ollama models
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 wingman.