| 711 | } |
| 712 | |
| 713 | function configModel(model: ModelsDev.Model) { |
| 714 | return { |
| 715 | id: model.id, |
| 716 | name: model.name, |
| 717 | family: model.family, |
| 718 | release_date: model.release_date, |
| 719 | attachment: model.attachment, |
| 720 | reasoning: model.reasoning, |
| 721 | temperature: model.temperature, |
| 722 | tool_call: model.tool_call, |
| 723 | interleaved: model.interleaved, |
| 724 | cost: model.cost ? { ...model.cost, tiers: undefined } : undefined, |
| 725 | limit: model.limit, |
| 726 | modalities: model.modalities, |
| 727 | status: model.status, |
| 728 | provider: model.provider, |
| 729 | } |
| 730 | } |
| 731 | |
| 732 | function createEventStream(chunks: unknown[], includeDone = false) { |
| 733 | const lines = chunks.map((chunk) => `data: ${typeof chunk === "string" ? chunk : JSON.stringify(chunk)}`) |