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

Anthropic-specific prompts needed for classification and agent tasks #211

Open
4 tasks
dhirenmathur opened this issue Dec 13, 2024 · 12 comments
Open
4 tasks
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@dhirenmathur
Copy link
Contributor

Issue Summary

While PR #203 fixed basic Anthropic integration, the current prompts are not optimized for Anthropic models. We need to update classification prompts and agent task descriptions to improve performance with Anthropic models while work continues on dynamic prompt injection (#189).

Current Status

Action Items

  • Review and update classification prompts for Anthropic compatibility
  • Revise agent task descriptions to align with Anthropic's capabilities
  • Test updated prompts with Anthropic models
  • Document Anthropic-specific prompt patterns that work well

Related Issues/PRs

Additional Context

This is an interim solution while the more comprehensive dynamic prompt injection system is being developed. Once #189 is completed, these Anthropic-specific prompts can be integrated into the dynamic system.

@dhirenmathur dhirenmathur added good first issue Good for newcomers help wanted Extra attention is needed labels Dec 13, 2024
@simin75simin
Copy link

@dhirenmathur I'd like to contribute to this issue. Could you assigned this to me? Thanks!

@dhirenmathur
Copy link
Contributor Author

Gladly! Thank you and all the best!

@dhirenmathur
Copy link
Contributor Author

Hey @simin75simin what were your final findings?

@simin75simin
Copy link

could not test comprehensively right now cause an issue in local repo reads: 'Repo' object has no method 'get_contents'

it seems there are two packages used: gitPython (import git) and pyGithub (import github) and pyGithub has get_contents for production mode, which grabs the repo online.

trying to install production mode for now. @dhirenmathur

@dhirenmathur
Copy link
Contributor Author

@simin75simin understood, we didn't face this bug when we were testing it that day correct? Did you try to test something different? Could you please provide steps to reproduce and open an issue for it? Thanks!

@simin75simin
Copy link

simin75simin commented Jan 23, 2025

it seemed this bug is only present for anthropic. still trying to pin down how exactly it happened. maybe it's some network issue on my local PC that uses a proxy & WSL 2. but this does not look likely because i can use litellm & anthropic from python shell in the same terminal. maybe something else.

on my PC this error was triggered by going into the postgres docker container and added the preferred AI for the defaultuser to be 'anthropic' and followed readme. @dhirenmathur

@dhirenmathur
Copy link
Contributor Author

If you remove the preferred provider from db it works end to end like we tried previously?

@simin75simin
Copy link

simin75simin commented Jan 23, 2025

yes, and if i change it to openai it also works, but if i change it to anthropic it gives UNEXPECTED_EOF_WHILE_READING and even though sometimes the call to the AI works Anthropic gives responses suggesting it cannot access context i.e. the repo. no problem with openai though.

@dhirenmathur
Copy link
Contributor Author

And to confirm, you used the API to set the provider in the database? (To make sure that the format is correct in the database)

@simin75simin
Copy link

simin75simin commented Jan 23, 2025

no but i can try

also if it's openai it works, like

UPDATE user_preferences
SET preferences = '{"llm_provider": "openai"}'
WHERE user_id = 'defaultuser';

but if i change the word openai to anthropic it throws UNEXPECTED_EOF_WHILE_READING

@simin75simin
Copy link

simin75simin commented Jan 23, 2025

so i tried using API to set provider in database but same error. i got a 200 from Anthropic but then started getting one UNEXPECTED_EOF_WHILE_READING. looking into this.

@simin75simin
Copy link

simin75simin commented Jan 23, 2025

looks like some format conversion mistake with Pydantic with PydanticOutputParser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants