feat(agents): update types
This commit is contained in:
parent
e4faa82362
commit
8bb3e4f016
|
@ -66,7 +66,7 @@ const basicAcademicSearchResponsePrompt = `
|
||||||
const strParser = new StringOutputParser();
|
const strParser = new StringOutputParser();
|
||||||
|
|
||||||
const handleStream = async (
|
const handleStream = async (
|
||||||
stream: AsyncGenerator<StreamEvent, any, unknown>,
|
stream: IterableReadableStream<StreamEvent>,
|
||||||
emitter: eventEmitter,
|
emitter: eventEmitter,
|
||||||
) => {
|
) => {
|
||||||
for await (const event of stream) {
|
for await (const event of stream) {
|
||||||
|
|
|
@ -66,7 +66,7 @@ const basicRedditSearchResponsePrompt = `
|
||||||
const strParser = new StringOutputParser();
|
const strParser = new StringOutputParser();
|
||||||
|
|
||||||
const handleStream = async (
|
const handleStream = async (
|
||||||
stream: AsyncGenerator<StreamEvent, any, unknown>,
|
stream: IterableReadableStream<StreamEvent>,
|
||||||
emitter: eventEmitter,
|
emitter: eventEmitter,
|
||||||
) => {
|
) => {
|
||||||
for await (const event of stream) {
|
for await (const event of stream) {
|
||||||
|
|
|
@ -22,6 +22,7 @@ import logger from '../utils/logger';
|
||||||
import LineListOutputParser from '../lib/outputParsers/listLineOutputParser';
|
import LineListOutputParser from '../lib/outputParsers/listLineOutputParser';
|
||||||
import { getDocumentsFromLinks } from '../lib/linkDocument';
|
import { getDocumentsFromLinks } from '../lib/linkDocument';
|
||||||
import LineOutputParser from '../lib/outputParsers/lineOutputParser';
|
import LineOutputParser from '../lib/outputParsers/lineOutputParser';
|
||||||
|
import { IterableReadableStream } from '@langchain/core/utils/stream';
|
||||||
|
|
||||||
const basicSearchRetrieverPrompt = `
|
const basicSearchRetrieverPrompt = `
|
||||||
You will be given a conversation below and a follow up question. You need to rephrase the follow-up question if needed so it is a standalone question that can be used by the LLM to search the web for information.
|
You will be given a conversation below and a follow up question. You need to rephrase the follow-up question if needed so it is a standalone question that can be used by the LLM to search the web for information.
|
||||||
|
@ -95,7 +96,7 @@ const basicWebSearchResponsePrompt = `
|
||||||
const strParser = new StringOutputParser();
|
const strParser = new StringOutputParser();
|
||||||
|
|
||||||
const handleStream = async (
|
const handleStream = async (
|
||||||
stream: AsyncGenerator<StreamEvent, any, unknown>,
|
stream: IterableReadableStream<StreamEvent>,
|
||||||
emitter: eventEmitter,
|
emitter: eventEmitter,
|
||||||
) => {
|
) => {
|
||||||
for await (const event of stream) {
|
for await (const event of stream) {
|
||||||
|
|
|
@ -65,7 +65,7 @@ const basicWolframAlphaSearchResponsePrompt = `
|
||||||
const strParser = new StringOutputParser();
|
const strParser = new StringOutputParser();
|
||||||
|
|
||||||
const handleStream = async (
|
const handleStream = async (
|
||||||
stream: AsyncGenerator<StreamEvent, any, unknown>,
|
stream: IterableReadableStream<StreamEvent>,
|
||||||
emitter: eventEmitter,
|
emitter: eventEmitter,
|
||||||
) => {
|
) => {
|
||||||
for await (const event of stream) {
|
for await (const event of stream) {
|
||||||
|
|
|
@ -19,7 +19,7 @@ Since you are a writing assistant, you would not perform web searches. If you th
|
||||||
const strParser = new StringOutputParser();
|
const strParser = new StringOutputParser();
|
||||||
|
|
||||||
const handleStream = async (
|
const handleStream = async (
|
||||||
stream: AsyncGenerator<StreamEvent, any, unknown>,
|
stream: IterableReadableStream<StreamEvent>,
|
||||||
emitter: eventEmitter,
|
emitter: eventEmitter,
|
||||||
) => {
|
) => {
|
||||||
for await (const event of stream) {
|
for await (const event of stream) {
|
||||||
|
|
|
@ -66,7 +66,7 @@ const basicYoutubeSearchResponsePrompt = `
|
||||||
const strParser = new StringOutputParser();
|
const strParser = new StringOutputParser();
|
||||||
|
|
||||||
const handleStream = async (
|
const handleStream = async (
|
||||||
stream: AsyncGenerator<StreamEvent, any, unknown>,
|
stream: IterableReadableStream<StreamEvent>,
|
||||||
emitter: eventEmitter,
|
emitter: eventEmitter,
|
||||||
) => {
|
) => {
|
||||||
for await (const event of stream) {
|
for await (const event of stream) {
|
||||||
|
|
Loading…
Reference in New Issue