Comments (9)
Update to the latest version with npm install langchain@latest
and try again
from langchainjs.
npm view langchain version
still shows the same version (0.0.44
) but it is working now, thanks!
Is there an example of how to send the response of the ChatOpenAI
streamed back to the client from the cf workers?
Edit: I got it working here, in case someone is interested: https://gist.github.com/alberduris/32e4ad5827cb01c28022ded982bfd8bc
from langchainjs.
Could you provide a bit more context of what's the desired outcome?
from langchainjs.
The official openai library (which we use) uses axios
to make http requests.
Axios off-the-shelf doesn't work in non-node environments.
For non-streaming output we already use an axios adapter (https://github.com/hwchase17/langchainjs/blob/main/langchain/src/util/axios-fetch-adapter.js) to make it work outside Node. This issue is about updating that adapter to support the SSE responses that OpenAI uses for streaming
from langchainjs.
Is it possible now to make streaming OpenAI requests, for example, on Cloudflare Workers? If so, how?
from langchainjs.
To set up Cloudflare Workers see #212 (comment)
To set up streaming see https://js.langchain.com/docs/modules/models/llms/additional_functionality#streaming-responses
from langchainjs.
It's not working. I have followed those instructions and (after fixing several process is not defined
errors) I'm still getting the ✘ [ERROR] Uncaught (in response) TypeError: adapter is not a function
error as described https://github.com/fern-openai/openai-node/issues/7 and openai/openai-node#30 (comment).
from langchainjs.
Which version of langchain are you using?
from langchainjs.
Which version of langchain are you using?
From your package.json
specification:
"dependencies": {
"langchain": "^0.0.35"
}
I get:
> npm view langchain version
$ 0.0.44
from langchainjs.
Related Issues (20)
- JSON Parsing Error with Mistral Azure using tools and chain HOT 2
- Langchain Redis integration library has not been package/built despite changes being made HOT 2
- Single-Step Tool Use (Function Calling) not working With Cohere HOT 3
- Docs refactor/parity with LangChain Python docs
- Google Gemini + DynamoDB chat memory fails by getting an empty string chunk HOT 2
- LLMGraphTransformer.convertToGraphDocuments function fails sometimes when prompt chain to fetch nodes and relationships returns null or missing data HOT 1
- Astra DB - collection bug HOT 11
- Cannot read properties of undefined (reading 'replace') at OpenAIEmbeddings.embedQuery HOT 3
- MistralAI - 422 Extra inputs are not permitted HOT 2
- Error: Cannot read properties of undefined (reading 'embedDocuments') HOT 2
- keepSeparator doesn't work with RecursiveCharacterTextSplitter HOT 4
- Error : Cannot get final name for export 'getRuntime' of ./node_modules/openai/_shims/auto/runtime-node.mjs HOT 3
- Could not import faiss-node. Please install as a dependency with npm install -S faiss-node HOT 1
- run with Deno with "Relative import path" error HOT 1
- LangSmith "Criteria()" and "LabeledCriteria()" do not accept custom criteria in TypeScript, despite examples HOT 5
- Unable to use non-Gemini models through ChatVertexAI HOT 2
- TypeError: Converting circular structure to JSON when enabling LangSmith HOT 4
- When streaming character arrays using the Baidu Wenxin chat model, there is a risk of cutting through a multi-byte character HOT 1
- Cannot read properties of undefined (reading 'log') - AgentExecutor HOT 1
- isAIMessage is not exported HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from langchainjs.