mayooear / gpt4-pdf-chatbot-langchain

GPT4 & LangChain Chatbot for large PDF docs
https://www.youtube.com/watch?v=ih9PBGVVOO4
14.92k stars 3.02k forks source link

error [TypeError: t.replaceAll is not a function] #59

Closed text2sql closed 1 year ago

text2sql commented 1 year ago

Document { pageContent: 'But, it added, this “is not a case in which the record contains \n' + 'sufficient factual findings upon which we could base a de\n' + 'novo assessment of Google’s affirmative defense of fair use.” \n' + 'Id., at 1377. And it remanded the case for another trial on \n' + 'that question. Google petitioned this Court for a writ of cer-\n' + 'tiorari, seeking review of the Federal Circuit’s copyrighta-\n' + 'bility determination. We denied the petition. Google, Inc. \n' + 'v. Oracle America, Inc., 576 U. S. 1071 (2015).\n' + 'On remand the District Court, sitting with a jury, heard\n' + 'evidence for a week. The court instructed the jury to an-\n' + 'swer one question: Has Google “shown by a preponderance\n' + 'of the evidence that its use in Android” of the declaring code', metadata: { source: 'docs/18-956_d18f.pdf' } }, Document { pageContent: '11 Cite as: 593 U. S. ____ (2021) \n' + 'Opinion of the Court \n' + 'and organizational structure contained in the 37 Sun Java\n' + 'API packages that it copied “constitutes a ‘fair use’ under \n' + 'the Copyright Act?” App. 294. After three days of deliber-\n' + 'ation the jury answered the question in the affirmative. Id., \n' + 'at 295. Google had shown fair use.\n' + 'Oracle again appealed to the Federal Circuit. And the \n' + 'Circuit again reversed the District Court. The Federal Cir-\n' + 'cuit assumed all factual questions in Google’s favor. But, it \n' + 'said, the question whether those facts constitute a “fair use” \n' + 'is a question of law. 886 F. 3d, at 1193. Deciding that ques-\n' + 'tion of law, the court held that Google’s use of the Sun Java \n' + 'API was not a fair use. It wrote that “[t]here is nothing fair \n' + 'about taking a copyrighted work verbatim and using it for \n' + 'the same purpose and function as the original in a compet-\n' + 'ing platform.” Id., at 1210. It remanded the case again,', metadata: { source: 'docs/18-956_d18f.pdf' } }, Document { pageContent: 'about taking a copyrighted work verbatim and using it for \n' + 'the same purpose and function as the original in a compet-\n' + 'ing platform.” Id., at 1210. It remanded the case again,\n' + 'this time for a trial on damages.\n' + 'Google then filed a petition for certiorari in this Court. It \n' + 'asked us to review the Federal Circuit’s determinations as \n' + 'to both copyrightability and fair use. We granted its\n' + 'petition. \n' + 'III \n' + 'A \n' + 'Copyright and patents, the Constitution says, are to “pro-\n' + 'mote the Progress of Science and useful Arts, by securing \n' + 'for limited Times to Authors and Inventors the exclusive \n' + 'Right to their respective Writings and Discoveries.” Art. I, \n' + '§8, cl. 8. Copyright statutes and case law have made clear\n' + 'that copyright has practical objectives. It grants an author\n' + 'an exclusive right to produce his work (sometimes for a \n' + 'hundred years or more), not as a special reward, but in or-\n' + 'der to encourage the production of works that others might', metadata: { source: 'docs/18-956_d18f.pdf' } }, Document { pageContent: 'an exclusive right to produce his work (sometimes for a \n' + 'hundred years or more), not as a special reward, but in or-\n' + 'der to encourage the production of works that others might \n' + 'reproduce more cheaply. At the same time, copyright \n' + 'has negative features. Protection can raise prices to con-\n' + 'sumers. It can impose special costs, such as the cost of con-\n' + 'tacting owners to obtain reproduction permission. And the', metadata: { source: 'docs/18-956_d18f.pdf' } }, Document { pageContent: '12 GOOGLE LLC v. ORACLE AMERICA, INC. \n' + 'Opinion of the Court \n' + 'exclusive rights it awards can sometimes stand in the way\n' + 'of others exercising their own creative powers. See gener-\n' + 'ally Twentieth Century Music Corp. v. Aiken, 422 U. S. 151, \n' + '156 (1975); Mazer v. Stein, 347 U. S. 201, 219 (1954).\n' + 'Macaulay once said that the principle of copyright is a\n' + '“tax on readers for the purpose of giving a bounty to writ-\n' + 'ers.” T. Macaulay, Speeches on Copyright 25 (E. Miller ed. \n' + '1913). Congress, weighing advantages and disadvantages, \n' + 'will determine the more specific nature of the tax, its \n' + 'boundaries and conditions, the existence of exceptions and \n' + 'exemptions, all by exercising its own constitutional power \n' + 'to write a copyright statute. \n' + 'Four provisions of the current Copyright Act are of par-\n' + 'ticular relevance in this case. First, a definitional provision', metadata: { source: 'docs/18-956_d18f.pdf' } }, Document { pageContent: 'to write a copyright statute. \n' + 'Four provisions of the current Copyright Act are of par-\n' + 'ticular relevance in this case. First, a definitional provision \n' + 'sets forth three basic conditions for obtaining a copyright.\n' + 'There must be a “wor[k] of authorship,” that work must be\n' + '“original,” and the work must be “fixed in any tangible me-\n' + 'dium of expression.” 17 U. S. C. §102(a); see also Feist Pub-\n' + 'lications, Inc. v. Rural Telephone Service Co., 499 U. S. 340, \n' + '345 (1991) (explaining that copyright requires some origi-\n' + 'nal “creative spark” and therefore does not reach the facts \n' + 'that a particular expression describes). \n' + 'Second, the statute lists certain kinds of works that cop-\n' + 'yright can protect. They include “literary,” “musical,” “dra-\n' + 'matic,” “motion pictur[e],” “architectural,” and certain \n' + 'other works. §102(a). In 1980, Congress expanded the\n' + 'reach of the Copyright Act to include computer programs. \n' + 'And it defined “computer program” as “‘a set of statements', metadata: { source: 'docs/18-956_d18f.pdf' } }, Document { pageContent: 'other works. §102(a). In 1980, Congress expanded the\n' + 'reach of the Copyright Act to include computer programs. \n' + 'And it defined “computer program” as “‘a set of statements \n' + 'or instructions to be used directly or indirectly in a com-\n' + 'puter in order to bring about a certain result.’” §10, 94 Stat.\n' + '3028 (codified at 17 U. S. C. §101).\n' + 'Third, the statute sets forth limitations on the works that \n' + 'can be copyrighted, including works that the definitional\n' + 'provisions might otherwise include. It says, for example,\n' + 'that copyright protection cannot be extended to “any idea, \n' + 'procedure, process, system, method of operation, concept,', metadata: { source: 'docs/18-956_d18f.pdf' } } ] before embedDocuments error [TypeError: t.replaceAll is not a function] /Users/truffles/Library/Mobile Documents/com~apple~CloudDocs/Data Science/My Projects/gpt4-pdf-chatbot-langchain/scripts/ingest-data.ts:56 throw new Error('Failed to ingest your data'); ^

[Error: Failed to ingest your data]

Node.js v18.15.0

text2sql commented 1 year ago

I tried to change replaceAll to replace in chat.ts, still the same issue

text2sql commented 1 year ago

fixed it already. thanks

mrcruz117 commented 1 year ago

fixed it already. thanks

What was the fix? I'm, getting the same error.