mirror of
https://github.com/langchain-ai/langserve.git
synced 2026-07-25 05:05:30 -04:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d66567dd1f | |||
| 65d814aa51 | |||
| c2bae658d2 | |||
| 803c587131 | |||
| 5b21b056df | |||
| 59f26055e0 | |||
| 24d804c073 | |||
| 31ad97b9e0 |
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"contributors": ["eyurtsev", "hwchase17", "nfcampos", "efriis", "jacoblee93", "dqbd", "kreneskyp", "adarsh-jha-dev", "harris", "baskaryan", "hinthornw", "bracesproul", "jakerachleff", "craigsdennis", "anhi", "169", "LarchLiu", "PaulLockett", "RCMatthias", "jwynia", "majiayu000", "mpskex", "shivachittamuru", "sinashaloudegi", "sowsan", "akira", "lucianotonet", "JGalego", "nat-n", "dirien"],
|
||||
"contributors": ["eyurtsev", "hwchase17", "nfcampos", "efriis", "jacoblee93", "dqbd", "kreneskyp", "adarsh-jha-dev", "harris", "baskaryan", "hinthornw", "bracesproul", "jakerachleff", "craigsdennis", "anhi", "169", "LarchLiu", "PaulLockett", "RCMatthias", "jwynia", "majiayu000", "mpskex", "shivachittamuru", "sinashaloudegi", "sowsan", "akira", "lucianotonet", "JGalego", "nat-n"],
|
||||
"message": "Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the username {{usersWithoutCLA}} on file. In order for us to review and merge your code, please complete the Individual Contributor License Agreement here https://forms.gle/AQFbtkWRoHXUgipM6 .\n\nThis process is done manually on our side, so after signing the form one of the maintainers will add you to the contributors list.\n\nFor more details about why we have a CLA and other contribution guidelines please see: https://github.com/langchain-ai/langserve/blob/main/CONTRIBUTING.md."
|
||||
}
|
||||
|
||||
@@ -160,6 +160,3 @@ cython_debug/
|
||||
#.idea/
|
||||
|
||||
.envrc
|
||||
|
||||
# IntelliJ IDE's
|
||||
.idea
|
||||
|
||||
@@ -372,27 +372,6 @@ You can deploy to GCP Cloud Run using the following command:
|
||||
gcloud run deploy [your-service-name] --source . --port 8001 --allow-unauthenticated --region us-central1 --set-env-vars=OPENAI_API_KEY=your_key
|
||||
```
|
||||
|
||||
### Deploy using Infrastructure as Code
|
||||
|
||||
#### Pulumi
|
||||
|
||||
You can deploy your LangServe server with [Pulumi](https://www.pulumi.com/) using your preferred general purpose language. Below are some quickstart
|
||||
examples for deploying LangServe to different cloud providers.
|
||||
|
||||
These examples are a good starting point for your own infrastructure as code (IaC) projects. You can easily modify them to suit your needs.
|
||||
|
||||
|
||||
| Cloud | Language | Repository | Quickstart |
|
||||
|-------|------------|-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| AWS | dotnet | https://github.com/pulumi/examples/aws-cs-langserve | [](https://app.pulumi.com/new?template=https://github.com/pulumi/examples/aws-cs-langserve) |
|
||||
| AWS | golang | https://github.com/pulumi/examples/aws-go-langserve | [](https://app.pulumi.com/new?template=https://github.com/pulumi/examples/aws-go-langserve) |
|
||||
| AWS | python | https://github.com/pulumi/examples/aws-py-langserve | [](https://app.pulumi.com/new?template=https://github.com/pulumi/examples/aws-py-langserve) |
|
||||
| AWS | typescript | https://github.com/pulumi/examples/aws-ts-langserve | [](https://app.pulumi.com/new?template=https://github.com/pulumi/examples/aws-ts-langserve) |
|
||||
| AWS | javascript | https://github.com/pulumi/examples/aws-js-langserve | [](https://app.pulumi.com/new?template=https://github.com/pulumi/examples/aws-js-langserve) |
|
||||
|
||||
|
||||
|
||||
|
||||
### Community Contributed
|
||||
|
||||
#### Deploy to Railway
|
||||
|
||||
@@ -1366,9 +1366,7 @@ class APIHandler:
|
||||
raise HTTPException(
|
||||
400,
|
||||
"The feedback endpoint is only accessible when LangSmith is "
|
||||
+ "enabled on your LangServe server."
|
||||
+ "Please set `enable_feedback_endpoint=True` on your route and "
|
||||
+ "set the proper environment variables",
|
||||
+ "enabled on your LangServe server.",
|
||||
)
|
||||
|
||||
feedback_from_langsmith = self._langsmith_client.create_feedback(
|
||||
@@ -1406,9 +1404,7 @@ class APIHandler:
|
||||
raise HTTPException(
|
||||
400,
|
||||
"The feedback endpoint is only accessible when LangSmith is "
|
||||
+ "enabled on your LangServe server."
|
||||
+ "Please set `enable_feedback_endpoint=True` on your route and "
|
||||
+ "set the proper environment variables",
|
||||
+ "enabled on your LangServe server.",
|
||||
)
|
||||
|
||||
async def check_feedback_enabled(self) -> bool:
|
||||
|
||||
+47
-47
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -5,7 +5,7 @@
|
||||
<link rel="icon" href="/____LANGSERVE_BASE_URL/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Playground</title>
|
||||
<script type="module" crossorigin src="/____LANGSERVE_BASE_URL/assets/index-dbc96538.js"></script>
|
||||
<script type="module" crossorigin src="/____LANGSERVE_BASE_URL/assets/index-a7c0cdaa.js"></script>
|
||||
<link rel="stylesheet" href="/____LANGSERVE_BASE_URL/assets/index-52e8ab2f.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -49,47 +49,32 @@ export const ChatMessageTuplesControlRenderer = withJsonFormsControlProps(
|
||||
(props) => {
|
||||
const data: Array<MessageTuple> = props.data ?? [];
|
||||
|
||||
useStreamCallback("onChunk", (_chunk, aggregatedState) => {
|
||||
useStreamCallback("onSuccess", (ctx) => {
|
||||
if (!isJsonSchemaExtra(props.schema)) return;
|
||||
const widget = props.schema.extra.widget;
|
||||
if (!("input" in widget) && !("output" in widget)) return;
|
||||
|
||||
const inputPath = getNormalizedJsonPath(widget.input ?? "");
|
||||
const outputPath = getNormalizedJsonPath(widget.output ?? "");
|
||||
|
||||
const isSingleOutputKey =
|
||||
aggregatedState?.final_output != null &&
|
||||
Object.keys(aggregatedState?.final_output).length === 1 &&
|
||||
Object.keys(aggregatedState?.final_output)[0] === "output";
|
||||
ctx.output != null &&
|
||||
Object.keys(ctx.output).length === 1 &&
|
||||
Object.keys(ctx.output)[0] === "output";
|
||||
|
||||
let ai = traverseNaiveJsonPath(aggregatedState?.final_output, outputPath);
|
||||
const human = traverseNaiveJsonPath(ctx.input, inputPath);
|
||||
let ai = traverseNaiveJsonPath(ctx.output, outputPath);
|
||||
|
||||
if (isSingleOutputKey) {
|
||||
ai = traverseNaiveJsonPath(ai, ["output", ...outputPath]) ?? ai;
|
||||
}
|
||||
|
||||
ai = getMessageContent(ai);
|
||||
if (typeof ai === "string") {
|
||||
props.handleChange(props.path, [...data.slice(0, -1), [data[data.length - 1][0], ai]]);
|
||||
if (typeof human === "string" && typeof ai === "string") {
|
||||
props.handleChange(props.path, [...data, [human, ai]]);
|
||||
}
|
||||
});
|
||||
|
||||
useStreamCallback("onStart", (ctx) => {
|
||||
if (!isJsonSchemaExtra(props.schema)) return;
|
||||
const widget = props.schema.extra.widget;
|
||||
if (!("input" in widget) && !("output" in widget)) return;
|
||||
|
||||
const inputPath = getNormalizedJsonPath(widget.input ?? "");
|
||||
|
||||
const human = traverseNaiveJsonPath(ctx.input, inputPath);
|
||||
if (typeof human === "string") {
|
||||
props.handleChange(props.path, [...data, [human, ""]]);
|
||||
}
|
||||
});
|
||||
|
||||
useStreamCallback("onError", () => {
|
||||
props.handleChange(props.path, [...data.slice(0, -1)]);
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="control">
|
||||
<div className="flex items-center justify-between">
|
||||
|
||||
@@ -101,12 +101,6 @@ export const ChatMessagesControlRenderer = withJsonFormsControlProps(
|
||||
props.handleChange(props.path, [...data, { content: "", type: "human" }]);
|
||||
});
|
||||
|
||||
useStreamCallback("onError", () => {
|
||||
if (data.length && data[data.length - 1].type === "ai") {
|
||||
props.handleChange(props.path, [...data.slice(0, -1)]);
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="control">
|
||||
<div className="flex items-center justify-between">
|
||||
|
||||
+1
-4
@@ -668,16 +668,13 @@ def add_routes(
|
||||
|
||||
if endpoint_configuration.is_playground_enabled:
|
||||
playground = app.get(
|
||||
namespace + "/playground/{file_path:path}",
|
||||
dependencies=dependencies,
|
||||
include_in_schema=False,
|
||||
namespace + "/playground/{file_path:path}", dependencies=dependencies
|
||||
)(api_handler.playground)
|
||||
|
||||
if endpoint_configuration.is_config_hash_enabled:
|
||||
app.get(
|
||||
namespace + "/c/{config_hash}/playground/{file_path:path}",
|
||||
dependencies=dependencies,
|
||||
include_in_schema=False,
|
||||
)(playground)
|
||||
|
||||
if enable_feedback_endpoint:
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "langserve"
|
||||
version = "0.0.47"
|
||||
version = "0.0.43"
|
||||
description = ""
|
||||
readme = "README.md"
|
||||
authors = ["LangChain"]
|
||||
|
||||
Reference in New Issue
Block a user