camel icon indicating copy to clipboard operation
camel copied to clipboard

Feat: Add support for loading model configs from YAML and JSON files.

Open SaranshPandya opened this issue 9 months ago • 2 comments

  • Added functionality to load model configurations from both YAML and JSON files.
  • Implemented create_from_yaml() and create_from_json() functions.
  • Improved error handling for invalid or missing configurations.
  • Ensured compatibility with existing model factory logic.

Closes #1587

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • [x] I have read the CONTRIBUTION guide (required)
  • [x] I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • [x] I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • [x] I have updated the tests accordingly (required for a bug fix or a new feature)
  • [x] I have updated the documentation if needed:
  • [x] I have added examples if this is a new feature

If you are unsure about any of these, don't hesitate to ask. We are here to help!

SaranshPandya avatar Mar 16 '25 16:03 SaranshPandya

I noticed that some tests are failing, but my PR does not modify those files. These failures seem unrelated to my changes. Could you confirm if I need to do anything, or can this PR be merged as is?

SaranshPandya avatar Mar 16 '25 17:03 SaranshPandya

I noticed that some tests are failing, but my PR does not modify those files. These failures seem unrelated to my changes. Could you confirm if I need to do anything, or can this PR be merged as is?

hey @SaranshPandya thanks for the contribution and sorry for the late reply, some api key related test failed since you forked the repo and didn't have the key configured, you can simpily ignore the error related to api key, I just invited you to our org, so you can create new branch directly in camel repo~ We will review this PR soon

Wendong-Fan avatar Mar 18 '25 20:03 Wendong-Fan

I noticed that some tests are failing, but my PR does not modify those files. These failures seem unrelated to my changes. Could you confirm if I need to do anything, or can this PR be merged as is?

hey @SaranshPandya thanks for the contribution and sorry for the late reply, some api key related test failed since you forked the repo and didn't have the key configured, you can simpily ignore the error related to api key, I just invited you to our org, so you can create new branch directly in camel repo~ We will review this PR soon

Hey, sorry for delay. Just to confirm now I clone and create a branch directly from camel, right? Like I can push the branch now?

SaranshPandya avatar Mar 20 '25 23:03 SaranshPandya

I noticed that some tests are failing, but my PR does not modify those files. These failures seem unrelated to my changes. Could you confirm if I need to do anything, or can this PR be merged as is?

hey @SaranshPandya thanks for the contribution and sorry for the late reply, some api key related test failed since you forked the repo and didn't have the key configured, you can simpily ignore the error related to api key, I just invited you to our org, so you can create new branch directly in camel repo~ We will review this PR soon

Hey, sorry for delay. Just to confirm now I clone and create a branch directly from camel, right? Like I can push the branch now?

Hi @SaranshPandya,

Thanks for following up! Yes, you can clone the main camel repo directly and create your new branch there. That approach will automatically include the necessary keys and run the CI checks properly. Once you’ve pushed the branch to the main repo, feel free to open a fresh PR, and we’ll review it as soon as possible.

X-TRON404 avatar Mar 20 '25 23:03 X-TRON404

ERROR: Permission to camel-ai/camel.git denied to SaranshPandya.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Hey @Wendong-Fan @X-TRON404 , I am unable to push my branch.

SaranshPandya avatar Mar 21 '25 18:03 SaranshPandya

hey @SaranshPandya , I just invited you to camel org, please accept and try again~

Wendong-Fan avatar Mar 22 '25 07:03 Wendong-Fan

hey @SaranshPandya , I just invited you to camel org, please accept and try again~

@Wendong-Fan Yeah, got it. Sorry for delay in this. I have pushed and created a new pr. Passed all the test. Closing this one.

SaranshPandya avatar Mar 22 '25 15:03 SaranshPandya