Closed dseravalli closed 3 months ago
Hey @dseravalli have you tried skipLibCheck?
Your tsconfig.json
would look like this:
{
"compilerOptions": {
"strict": true,
"target": "es2022",
"module": "node16",
"lib": [
"dom",
"es2022"
],
"moduleResolution": "node16",
"rootDir": ".",
"outDir": "build",
"allowSyntheticDefaultImports": true,
"importHelpers": true,
"alwaysStrict": true,
"sourceMap": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitAny": false,
"noImplicitThis": false,
"strictNullChecks": false,
"skipLibCheck": true
},
"include": [
"src/**/*",
"__tests__/**/*"
]
}
@jose-mdz That clears up Cannot find module 'groq-sdk/resources/chat' or its corresponding type declarations.
(thank you) but Namespace ... has no exported member 'CompletionCreateParams'.
remains.
@dseravalli This question is more of a LangChain question, but one suggestion is the following...
The response in this example is of type:
type(response)
<class 'langchain_core.messages.ai.AIMessage'>
And the content can be extracted via:
response.content
You could try converting it into a string and then trying to extract content from it!
@dseravalli This question is more of a LangChain question, but one suggestion is the following...
The response in this example is of type:
type(response) <class 'langchain_core.messages.ai.AIMessage'>
And the content can be extracted via:
response.content
You could try converting it into a string and then trying to extract content from it!
I'll give it a shot. FYI this code I'm using is pulled directly from the README.
Hey @dseravalli have you tried skipLibCheck?
Your
tsconfig.json
would look like this:{ "compilerOptions": { "strict": true, "target": "es2022", "module": "node16", "lib": [ "dom", "es2022" ], "moduleResolution": "node16", "rootDir": ".", "outDir": "build", "allowSyntheticDefaultImports": true, "importHelpers": true, "alwaysStrict": true, "sourceMap": true, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, "noImplicitReturns": true, "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, "skipLibCheck": true }, "include": [ "src/**/*", "__tests__/**/*" ] }
Instead of skipping the lib check, I think it's better to fix the error in the code.
FYI, I tried changing import { ChatCompletion } from 'groq-sdk/resources/chat/';
in groq-sdk/lib/chat_completions_ext.d.ts
to import { ChatCompletion } from 'groq-sdk/resources/chat/index'
;`, and after this change, the TS compilation succeeded.
A fix for this issue has been publish in release v0.3.3.
Thanks for the fix @gamer-mitsuha
v0.3.2
Running
tsc -p tsconfig.json
with this config: