rig icon indicating copy to clipboard operation
rig copied to clipboard

feat: Inception provider

Open cbrit opened this issue 9 months ago • 8 comments

Closes #393

cbrit avatar Apr 11 '25 17:04 cbrit

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

yavens avatar Apr 11 '25 17:04 yavens

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.

cbrit avatar Apr 11 '25 17:04 cbrit

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?"}]}]}

cbrit avatar Apr 11 '25 19:04 cbrit

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?"}]}]}

It seems like a lot of "openai compatible" apis are like this which makes me think we might want a custom serializer here..

0xMochan avatar Apr 12 '25 18:04 0xMochan

@0xMochan Reverted to the custom message implementation

cbrit avatar Apr 16 '25 18:04 cbrit

@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 avatar Apr 30 '25 06:04 0xMochan

@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 avatar May 07 '25 16:05 cbrit

@cbrit Don't suppose anything has changed on this? I'm looking into potentially adding more new providers.

joshua-mo-143 avatar Jun 20 '25 14:06 joshua-mo-143