-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* first commit * copy template from openai plugin * workaround for CommonJS import error + setting types to mistral library * still adjusting the types to Mistral * fixed all type errors * fixed dep issue * model registered * first inference done * json mode working * changed conventions * aligning the version of genkit --------- Co-authored-by: BENDINELLI Tommaso <tommaso.bendinelli@csem.ch> Co-authored-by: David Oort Alonso <davidoort@hotmail.com>
- Loading branch information
1 parent
ddab7c9
commit e1763a3
Showing
7 changed files
with
356 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ node_modules/ | |
.nx/ | ||
lib/ | ||
.env | ||
temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Copyright 2024 The Fire Company | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
import { defineEmbedder, embedderRef } from '@genkit-ai/ai/embedder'; | ||
import { z } from 'zod'; | ||
export const TextEmbeddingConfigSchema = z.object({ | ||
dimensions: z.number().optional(), | ||
encodingFormat: z.union([z.literal('float'), z.literal('base64')]).optional(), | ||
}); | ||
|
||
|
||
export const mistralembed = embedderRef({ | ||
name: 'mistral/mistral-embed', | ||
configSchema: TextEmbeddingConfigSchema, | ||
info: { | ||
dimensions: 1024, | ||
label: 'Mistral - Mistral Embed', | ||
supports: { | ||
input: ['text'], | ||
}, | ||
}, | ||
}); | ||
export const SUPPORTED_EMBEDDING_MODELS = { | ||
'mistral-embed': mistralembed | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.