Skip to content

Commit 155bb7a

Browse files
committed
Merge branch 'master' into agentic-streaming
2 parents 9a99933 + bb7d65f commit 155bb7a

File tree

4 files changed

+35
-36
lines changed

4 files changed

+35
-36
lines changed

collector/processSingleFile/convert/asMbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const {
99
const { tokenizeString } = require("../../utils/tokenizer");
1010
const { default: slugify } = require("slugify");
1111

12-
async function asMbox({ fullFilePath = "", filename = "" }) {
12+
async function asMbox({ fullFilePath = "", filename = "", options = {} }) {
1313
console.log(`-- Working ${filename} --`);
1414

1515
const mails = await mboxParser(fs.createReadStream(fullFilePath))

collector/processSingleFile/convert/asOfficeMime.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ const {
88
const { tokenizeString } = require("../../utils/tokenizer");
99
const { default: slugify } = require("slugify");
1010

11-
async function asOfficeMime({ fullFilePath = "", filename = "" }) {
11+
async function asOfficeMime({
12+
fullFilePath = "",
13+
filename = "",
14+
options = {},
15+
}) {
1216
console.log(`-- Working ${filename} --`);
1317
let content = "";
1418
try {

server/endpoints/api/openai/index.js

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const { extractTextContent, extractAttachments } = require("./helpers");
1818
function apiOpenAICompatibleEndpoints(app) {
1919
if (!app) return;
2020

21-
app.get("/v1/openai/models", [validApiKey], async (request, response) => {
21+
app.get("/v1/openai/models", [validApiKey], async (_, response) => {
2222
/*
2323
#swagger.tags = ['OpenAI Compatible Endpoints']
2424
#swagger.description = 'Get all available "models" which are workspaces you can use for chatting.'
@@ -28,22 +28,19 @@ function apiOpenAICompatibleEndpoints(app) {
2828
"schema": {
2929
"type": "object",
3030
"example": {
31-
"models": [
31+
"object": "list",
32+
"data": [
3233
{
33-
"name": "Sample workspace",
34-
"model": "sample-workspace",
35-
"llm": {
36-
"provider": "ollama",
37-
"model": "llama3:8b"
38-
}
34+
"id": "model-id-0",
35+
"object": "model",
36+
"created": 1686935002,
37+
"owned_by": "organization-owner"
3938
},
4039
{
41-
"name": "Second workspace",
42-
"model": "workspace-2",
43-
"llm": {
44-
"provider": "openai",
45-
"model": "gpt-3.5-turbo"
46-
}
40+
"id": "model-id-1",
41+
"object": "model",
42+
"created": 1686935002,
43+
"owned_by": "organization-owner"
4744
}
4845
]
4946
}
@@ -67,15 +64,16 @@ function apiOpenAICompatibleEndpoints(app) {
6764
model: workspace?.chatModel,
6865
});
6966
data.push({
70-
name: workspace.name,
71-
model: workspace.slug,
72-
llm: {
73-
provider: provider,
74-
model: LLMProvider.model,
75-
},
67+
id: workspace.slug,
68+
object: "model",
69+
created: Math.floor(Number(new Date(workspace.createdAt)) / 1000),
70+
owned_by: `${provider}-${LLMProvider.model}`,
7671
});
7772
}
78-
return response.status(200).json({ data });
73+
return response.status(200).json({
74+
object: "list",
75+
data,
76+
});
7977
} catch (e) {
8078
console.error(e.message, e);
8179
response.sendStatus(500).end();

server/swagger/openapi.json

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3410,22 +3410,19 @@
34103410
"schema": {
34113411
"type": "object",
34123412
"example": {
3413-
"models": [
3413+
"object": "list",
3414+
"data": [
34143415
{
3415-
"name": "Sample workspace",
3416-
"model": "sample-workspace",
3417-
"llm": {
3418-
"provider": "ollama",
3419-
"model": "llama3:8b"
3420-
}
3416+
"id": "model-id-0",
3417+
"object": "model",
3418+
"created": 1686935002,
3419+
"owned_by": "organization-owner"
34213420
},
34223421
{
3423-
"name": "Second workspace",
3424-
"model": "workspace-2",
3425-
"llm": {
3426-
"provider": "openai",
3427-
"model": "gpt-3.5-turbo"
3428-
}
3422+
"id": "model-id-1",
3423+
"object": "model",
3424+
"created": 1686935002,
3425+
"owned_by": "organization-owner"
34293426
}
34303427
]
34313428
}

0 commit comments

Comments
 (0)