Function
buildModelParams
(
pipe: Pipe,
stream: boolean,
messages: Message[]
)
Source from the content-addressed store, hash-verified
| 47 | } |
| 48 | |
| 49 | function buildModelParams( |
| 50 | pipe: Pipe, |
| 51 | stream: boolean, |
| 52 | messages: Message[] |
| 53 | ): ModelParams { |
| 54 | // Create model strings for Fireworks AI |
| 55 | const pipeModel = pipe.model.split(':')[1]; |
| 56 | const model = |
| 57 | pipeModel === 'yi-large' |
| 58 | ? 'accounts/yi-01-ai/models/yi-large' |
| 59 | : `accounts/fireworks/models/${pipeModel}`; |
| 60 | const { |
| 61 | top_p, |
| 62 | max_tokens, |
| 63 | temperature, |
| 64 | presence_penalty, |
| 65 | frequency_penalty, |
| 66 | stop |
| 67 | } = pipe; |
| 68 | return { |
| 69 | messages, |
| 70 | stream, |
| 71 | model, |
| 72 | top_p, |
| 73 | max_tokens, |
| 74 | temperature, |
| 75 | presence_penalty, |
| 76 | frequency_penalty, |
| 77 | stop |
| 78 | }; |
| 79 | } |
Tested by
no test coverage detected