Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dspy): together client response parsing bug + endpoint #627

Closed
wants to merge 1 commit into from

Conversation

adam-simple
Copy link
Contributor

@adam-simple adam-simple commented Mar 11, 2024

I opened up a related issue just now #626

Basically I was getting errors when using the Together client. If I set use_chat_api to true, the response did not have an "output" field. Also, if I set use_chat_api to false, I get a 404. These changes fix these issues.

I've only done a smoke test. probably worth at least a smoke test by whoever is reviewing this as well.

@arnavsinghvi11
Copy link
Collaborator

Thanks @adam-simple ! LGTM, but @insop do you want to run some checks on this? (since you added the Together client :).

@insop
Copy link
Contributor

insop commented Mar 12, 2024

Thank you @arnavsinghvi11 for looping me.

@adam-simple
Thank you for the PR.

I was using this API base as follows, and when you use this API_BASE, it was correct in both API URL and the output.

TOGETHER_API_BASE="https://api.together.xyz/inference"`

But, when I check the API doc, https://api.together.xyz/inference is deprecated.

So your change is great to remove the deprecated url.

If you could consider the follow two, it will be great.

  1. could you keep url as is url = f"{self.api_base}", so that TOGETHER_API_BASE is set to either https://api.together.xyz/v1/chat/completions or https://api.together.xyz/v1/completions
  2. if you could add API doc and the above TOGETHER_API_BASE to this document at docs/api/language_model_clients/Together.md it will be help others very much.

@someshfengde
Copy link
Contributor

@adam-simple it's not working I've tried the fix you mentioned can you please inform what did you set for TOGETHER_API_BASE

@someshfengde
Copy link
Contributor

someshfengde commented Mar 19, 2024

by using api_base as https://api.together.xyz/v1/chat
image

by using api_base as https://api.together.xyz/v1
image

Also tried by using use_chat_api = True

image

something is wrong with it ig

@insop
Copy link
Contributor

insop commented Mar 19, 2024

@someshfengde

Please seem y post above and that's what I was suggesting.

@someshfengde
Copy link
Contributor

I resolved this issue by using the OpenAI compatability together has. I created another handler for together.

using existing one was too much hassle for me.

If anyone needed here is the branch for fix:

https://github.com/curieo-org/dspy/tree/togetherAPIFIX

@okhat
Copy link
Collaborator

okhat commented Mar 19, 2024

Oops I spoke too fast. OK it seems that this is good to go once the issue faced by @someshfengde is fixed

@arnavsinghvi11
Copy link
Collaborator

Hi @someshfengde , did you want to add your changes for Together to this PR? maybe the ones that were removed from the other PR?

@someshfengde
Copy link
Contributor

Hi @someshfengde , did you want to add your changes for Together to this PR? maybe the ones that were removed from the other PR?

I'd have to open a different PR ig? right?

@arnavsinghvi11
Copy link
Collaborator

@adam-simple @someshfengde should this PR be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants