feat: Inception provider
Closes #393
It looks like Inception is an OpenAI-compatible provider. Is there a reason you can't reuse the types directly from the OAI module? See Hyperbolic's intergration
It looks like Inception is an OpenAI-compatible provider. Is there a reason you can't reuse the types directly from the OAI module? See Hyperbolic's intergration
Oh great catch. That would simplify things for sure.
So since the beta only supports text, it seems they don't yet accept structured content data in the content field of the messages:
// this works
{ ... "messages": [{ "content": "Hello, world!" }] }
// this is what OpenAI expects/OpenAI Message type serializes to. Does not work with Inception API right now
{ ... "messages": [{ "content": { "type": "text", "text": "Hello, world!" }}]}
So I was able to simplify it by using the OpenAI provider's streaming utility, but not by using its Message type.
The resulting runtime error if using the other Message type:
ProviderError: "detail":[{"type":"string_type","loc":["body","messages",0,"content"],"msg":"Input should be a valid string","input":[{"type":"text","text":"You are a helpful AI assistant."}]},{"type":"string_type","loc":["body","messages",1,"content"],"msg":"Input should be a valid string","input":[{"type":"text","text":"Hello, how are you?"}]}]}
So since the beta only supports text, it seems they don't yet accept structured content data in the
contentfield of the messages:// this works { ... "messages": [{ "content": "Hello, world!" }] } // this is what OpenAI expects/OpenAI Message type serializes to. Does not work with Inception API right now { ... "messages": [{ "content": { "type": "text", "text": "Hello, world!" }}]}So I was able to simplify it by using the OpenAI provider's streaming utility, but not by using its
Messagetype.The resulting runtime error if using the other
Messagetype:ProviderError: "detail":[{"type":"string_type","loc":["body","messages",0,"content"],"msg":"Input should be a valid string","input":[{"type":"text","text":"You are a helpful AI assistant."}]},{"type":"string_type","loc":["body","messages",1,"content"],"msg":"Input should be a valid string","input":[{"type":"text","text":"Hello, how are you?"}]}]}
It seems like a lot of "openai compatible" apis are like this which makes me think we might want a custom serializer here..
@0xMochan Reverted to the custom message implementation
@0xMochan Reverted to the custom message implementation
Is this bc they support the full content type now? otherwise, we can flag this for review?
@0xMochan Reverted to the custom message implementation
Is this bc they support the full content type now? otherwise, we can flag this for review?
We discussed in discord dms about reverting because they don't. I haven't actually checked to see if the API has changed though now that it's been a few weeks.
@cbrit Don't suppose anything has changed on this? I'm looking into potentially adding more new providers.