This repository was archived by the owner on Jul 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
feat: attach custom tracer w/ replicas as callback #86
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7a0702c
feat: stream in tracing context (wip)
lc-arjun 0630b5c
get real project name
lc-arjun 5d2aa0b
fixes
lc-arjun 7d8b62f
update meta api to support
lc-arjun cad4494
add version to api
lc-arjun 2b3910d
read version from fs
lc-arjun d6be0a0
bump other packages and yarn dedupe
lc-arjun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { zValidator } from "@hono/zod-validator"; | ||
import { Hono } from "hono"; | ||
import { HTTPException } from "hono/http-exception"; | ||
import { streamSSE } from "hono/streaming"; | ||
import { v4 as uuid4 } from "uuid"; | ||
import { z } from "zod"; | ||
import type { AuthContext } from "../auth/index.mjs"; | ||
import { getAssistantId } from "../graph/load.mjs"; | ||
import { zValidator } from "@hono/zod-validator"; | ||
import { logError, logger } from "../logging.mjs"; | ||
import * as schemas from "../schemas.mjs"; | ||
import { z } from "zod"; | ||
import { type Run, type RunKwargs, Runs, Threads } from "../storage/ops.mjs"; | ||
import { serialiseAsDict } from "../utils/serde.mjs"; | ||
import { | ||
getDisconnectAbortSignal, | ||
jsonExtra, | ||
waitKeepAlive, | ||
} from "../utils/hono.mjs"; | ||
import { logError, logger } from "../logging.mjs"; | ||
import { v4 as uuid4 } from "uuid"; | ||
import type { AuthContext } from "../auth/index.mjs"; | ||
import { serialiseAsDict } from "../utils/serde.mjs"; | ||
|
||
const api = new Hono(); | ||
|
||
|
@@ -52,6 +52,14 @@ const createValidRun = async ( | |
Object.assign(config.configurable, run.checkpoint); | ||
} | ||
|
||
if (run.langsmith_tracer) { | ||
config.configurable ??= {}; | ||
Object.assign(config.configurable, { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not do this in one line with a spread operator? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its a fair question. tbh just copied from above lol There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick` this is imo noisy, which is why I opted to do that instead
|
||
langsmith_project: run.langsmith_tracer.project_name, | ||
langsmith_example_id: run.langsmith_tracer.example_id, | ||
}); | ||
} | ||
|
||
if (headers) { | ||
for (const [rawKey, value] of headers.entries()) { | ||
const key = rawKey.toLowerCase(); | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this warrant a bump on
core
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the replicas stuff won't work without the bump to core