Open LuciusMos opened 4 days ago
Thanks @LuciusMos ! The 2nd solution your proposed looks better to me, we can make Installation and Setup
part with better structured, I also think we can support environment variable passing for OpenAICompatibilityModel
, like OPENAI_COMPATIBILIY_API_KEY
and OPENAI_COMPATIBILIY_API_KEY
, also mention this in doc for model , could you help with this?
Thanks @LuciusMos ! The 2nd solution your proposed looks better to me, we can make
Installation and Setup
part with better structured, I also think we can support environment variable passing forOpenAICompatibilityModel
, likeOPENAI_COMPATIBILIY_API_KEY
andOPENAI_COMPATIBILIY_API_KEY
, also mention this in doc for model , could you help with this?
@Wendong-Fan Thanks for the feedback! Yeah of course I would work on this with a new PR
Required prerequisites
Motivation
I am a new user of camel. When reading the agent-building doc for onboarding, I found there is no guidance on how I could use an OpenAI compatible api (In my case, I used deepseek api, which is quite popular for its strong performance and low price). And even worse, the current doc is a bit misleading. Here is how the doc says doc link
Because deepseek api uses
api_key="<DeepSeek API Key>", base_url="https://api.deepseek.com"
, which is compatible with OpenAI api, so I used the command line above to set env variable. However, it does not work. I think the reason is that, for theChatAgent
code in the doc, we do not pass a model, so it would use the default one, which only permits OpenAI api rather than other compatible ones code link:So I used
OpenAICompatibilityModel
to initialize a customized model and pass it into theChatAgent
and it worked, like the code below: (I stored the base url and key in.env
file, and usedload_dotenv()
to load)I think there would be many users who face similar confused situation like me. So I think we should modify the onboarding doc and give more detailed guidance on how to use OpenAI compatible apis.
Solution
Alternatives
No response
Additional context
No response