function! ClaudyImplement(user_prompt)
- let system_prompt = "reply with an implementation of one function in C should be able to copied right into an editor, no explaining text, start always with ```c and end with ```"
+ let system_prompt = "detect programming language, reply only with new functions, no explaining text, start always with ``` and end with ```"
+
+ let l:code_context = shellescape(join(getbufline(bufnr('%'), 1, '$')))
let json_data = {
\ 'model': 'claude-3-5-sonnet-20241022',
\ 'messages': [
\ {
\ 'role': 'user',
+ \ 'content': l:code_context
+ \ },
+ \ {
+ \ 'role': 'assistant',
+ \ 'content': "I see your existing code. What would you like to add or modify?"
+ \ },
+ \ {
+ \ 'role': 'user',
\ 'content': a:user_prompt
\ }
\ ]