Skip to content

Commit c73af77

Browse files
committed
Add formfactor COMPLETION which emulates Completion variant of the model
1 parent 5496a62 commit c73af77

File tree

4 files changed

+43
-2
lines changed

4 files changed

+43
-2
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ Models and Migrations
792792
- Autoheal `\r` in `CsvFormatParser` ~~`CsvFormatDefinition`~~
793793
- Add `getIndexedDbStorage`
794794
- Pipeline migrations
795-
- Add formfactor `WRITER` <!-- <- TODO: !!!! Review that this is the real ff added -->
795+
- Add formfactor `COMPLETION` which emulates `Completion` variant of the model <!-- <- TODO: !!!! Review that this is the real ff added -->
796796

797797
## Drafts
798798

book

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import type { AbstractFormfactorDefinition } from '../_common/AbstractFormfactorDefinition';
2+
3+
/**
4+
* Completion is formfactor that emulates completion models
5+
*
6+
* @public exported from `@promptbook/core`
7+
*/
8+
export const CompletionFormfactorDefinition = {
9+
name: 'COMPLETION',
10+
description: `@@@`,
11+
documentationUrl: `https://github.com/webgptorg/promptbook/discussions/@@`,
12+
// <- TODO: https://github.com/webgptorg/promptbook/discussions/new?category=concepts
13+
// "🔠 Completion Formfactor"
14+
15+
pipelineInterface: {
16+
inputParameters: [
17+
{
18+
name: 'inputText',
19+
description: `Input text to be completed`,
20+
isInput: true,
21+
isOutput: false,
22+
},
23+
{
24+
name: 'instructions',
25+
description: `Additional instructions for the model, for example the required length, empty by default`,
26+
isInput: true,
27+
isOutput: false,
28+
},
29+
],
30+
outputParameters: [
31+
{
32+
name: 'followingText',
33+
description: `Text that follows the input text`,
34+
isInput: false,
35+
isOutput: true,
36+
},
37+
],
38+
},
39+
} as const satisfies AbstractFormfactorDefinition;

src/formfactors/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ChatbotFormfactorDefinition } from './chatbot/ChatbotFormfactorDefinition';
2+
import { CompletionFormfactorDefinition } from './completion/CompletionFormfactorDefinition';
23
import { GeneratorFormfactorDefinition } from './generator/GeneratorFormfactorDefinition';
34
import { GenericFormfactorDefinition } from './generic/GenericFormfactorDefinition';
45
import { ImageGeneratorFormfactorDefinition } from './image-generator/ImageGeneratorFormfactorDefinition';
@@ -19,6 +20,7 @@ export const FORMFACTOR_DEFINITIONS = [
1920
MatcherFormfactorDefinition,
2021
GeneratorFormfactorDefinition,
2122
ImageGeneratorFormfactorDefinition,
23+
CompletionFormfactorDefinition,
2224
// <- [🛬] When making new formfactor, copy the _boilerplate and link it here
2325
] as const;
2426

0 commit comments

Comments
 (0)