Closed bracesproul closed 6 months ago
Hi, Brace! Thanks for reaching out. Could you please try again with groq-sdk
version 0.3.0?
Hi, Brace! Thanks for reaching out. Could you please try again with
groq-sdk
version 0.3.0?
still getting the same error :(
Hi @bracesproul - if you're looking to implement an interface, then Groq.Chat.CompletionCreateParams
is a namespace, not an interface. Maybe you mean Groq.Chat.CompletionCreateParams.Message
(which is an interface)?
something like:
class MyParams implements Groq.Chat.CompletionCreateParams.Message {
get role() {
return 'somerole';
}
get content() {
return 'somecontent';
}
}
If you want just the type of the whole params object, that would be ChatCompletionCreateParams
which you can import like so:
import { ChatCompletionCreateParams } from 'groq-sdk/resources/chat/completions';
function makeParams(): ChatCompletionCreateParams {...}
It might help to look at completions.ts to see how these things are defined more clearly. Does that help?
Hi @bracesproul - if you're looking to implement an interface, then
Groq.Chat.CompletionCreateParams
is a namespace, not an interface. Maybe you meanGroq.Chat.CompletionCreateParams.Message
(which is an interface)?something like:
class MyParams implements Groq.Chat.CompletionCreateParams.Message { get role() { return 'somerole'; } get content() { return 'somecontent'; } }
If you want just the type of the whole params object, that would be
ChatCompletionCreateParams
which you can import like so:import { ChatCompletionCreateParams } from 'groq-sdk/resources/chat/completions'; function makeParams(): ChatCompletionCreateParams {...}
It might help to look at completions.ts to see how these things are defined more clearly. Does that help?
Importing from the path you listed fixed it, I appreciate it!
I'm troubled by the same problem. I think this can be temporarily updated to the readme.
When trying to access
Groq.Chat.CompletionCreateParams
orGroq.Chat.Completions.CompletionCreateParams
(which my VSCode auto complete suggests as valid imports) I get the following error:TSConfig
groq-sdk
version:0.2.1
(latest)Is there a different recommended way to access this interface?