@hsupu/copilot-api 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -2052,10 +2052,10 @@ const createChatCompletions = async (payload) => {
|
|
|
2052
2052
|
//#endregion
|
|
2053
2053
|
//#region src/routes/chat-completions/handler.ts
|
|
2054
2054
|
async function handleCompletion$1(c) {
|
|
2055
|
-
const startTime = Date.now();
|
|
2056
2055
|
const originalPayload = await c.req.json();
|
|
2057
2056
|
consola.debug("Request payload:", JSON.stringify(originalPayload).slice(-400));
|
|
2058
2057
|
const trackingId = c.get("trackingId");
|
|
2058
|
+
const startTime = (trackingId ? requestTracker.getRequest(trackingId) : void 0)?.startTime ?? Date.now();
|
|
2059
2059
|
updateTrackerModel$1(trackingId, originalPayload.model);
|
|
2060
2060
|
const ctx = {
|
|
2061
2061
|
historyId: recordRequest("openai", {
|
|
@@ -4017,10 +4017,10 @@ function translateErrorToAnthropicErrorEvent() {
|
|
|
4017
4017
|
//#endregion
|
|
4018
4018
|
//#region src/routes/messages/handler.ts
|
|
4019
4019
|
async function handleCompletion(c) {
|
|
4020
|
-
const startTime = Date.now();
|
|
4021
4020
|
const anthropicPayload = await c.req.json();
|
|
4022
4021
|
consola.debug("Anthropic request payload:", JSON.stringify(anthropicPayload));
|
|
4023
4022
|
const trackingId = c.get("trackingId");
|
|
4023
|
+
const startTime = (trackingId ? requestTracker.getRequest(trackingId) : void 0)?.startTime ?? Date.now();
|
|
4024
4024
|
updateTrackerModel(trackingId, anthropicPayload.model);
|
|
4025
4025
|
const ctx = {
|
|
4026
4026
|
historyId: recordRequest("anthropic", {
|