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

Send message need to update model from claude-2 to claude-2.1 #85

Open
nt1r opened this issue Nov 21, 2023 · 11 comments
Open

Send message need to update model from claude-2 to claude-2.1 #85

nt1r opened this issue Nov 21, 2023 · 11 comments

Comments

@nt1r
Copy link

nt1r commented Nov 21, 2023

Error response:

{
  "error": {
    "type": "permission_error",
    "message": "Invalid model",
    "code": "model_not_allowed"
  }
}

Chrome browser fetch:

{
  "completion": {
    "prompt": "Hi",
    "timezone": "Asia/Shanghai",
    "model": "claude-2.1" # update here
  },
  "organization_uuid": "xxxxxx",
  "conversation_uuid": "xxxxxx",
  "text": "Hi",
  "attachments": []
}

=-=-=-=-= 2023/11/22 =-=-=-=-=
Claude model name seems to be updated to 'claude-2.1' on 2023/11/22.

=-=-=-=-= 2023/11/21 =-=-=-=-=
Claude model name seems to be updated to 'claude-2.0-magenta' on 2023/11/21.

@wmcaeddy
Copy link

wmcaeddy commented Nov 21, 2023

Hi nt1r, did you try to update your code?
It shows this error today, not sure if it is related
Traceback (most recent call last):
File "/home/xxx/Claude-API/usecases/console_chat.py", line 32, in
main()
File "/home/xxx/Claude-API/usecases/console_chat.py", line 28, in main
response = claude.send_message(user_input, conversation_id)
File "/home/xxx/.local/lib/python3.10/site-packages/claude_api.py", line 129, in send_message
data = json.loads(json_str)
File "/usr/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@nt1r
Copy link
Author

nt1r commented Nov 21, 2023

Hi nt1r, did you try to update your code?
It shows this error today, not sure if it is related

@wmcaeddy Hi, there. I'm not sure if this error is caused by the model name change. I'm not very good at Python, sorry I can't help you locate the error. Recently I've been referencing the code from this project and refactoring it using the Kotlin language. Today when I was writing the Ktor server side code I came across this Error, so I decided to open this Issue here.

Translated by Claude.

PS: You can checkout the pull request I submitted today and see if the error has been resolved.

@Lxb921006
Copy link

@nt1r thank you, this is useful

@roaringmyshallowwater
Copy link

Thanks for the update! I encountered a similar problem and your solution successfully solved the problem!

Traceback (most recent call last):
  File "E:\0nlp\Claude-API-main\usecases\console_chat.py", line 43, in <module>
    main()
  File "E:\0nlp\Claude-API-main\usecases\console_chat.py", line 36, in main
    response = claude.send_message(user_input, conversation_id, timeout=600)
  File "E:\0nlp\Claude-API-main\claude-api\claude_api.py", line 137, in send_message
    data = json.loads(json_str)
  File "C:\Users\14416\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\14416\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\14416\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@Lxb921006
Copy link

It seems that the model has been updated, claude-2.1

@roaringmyshallowwater
Copy link

It seems that the model has been updated, claude-2.1

you are right. thanks

@nt1r nt1r changed the title Send message need to update model from claude-2 to claude-2.0-magenta Send message need to update model from claude-2 to claude-2.1 Nov 22, 2023
@Randomboiii03
Copy link

Hi nt1r, did you try to update your code?
It shows this error today, not sure if it is related

@wmcaeddy Hi, there. I'm not sure if this error is caused by the model name change. I'm not very good at Python, sorry I can't help you locate the error. Recently I've been referencing the code from this project and refactoring it using the Kotlin language. Today when I was writing the Ktor server side code I came across this Error, so I decided to open this Issue here.

Translated by Claude.

PS: You can checkout the pull request I submitted today and see if the error has been resolved.

Hello, do you have the the API translated in kotlin? May I ask if I can get a copy, I'm working on my school project, it will helps a lot. Thanks

@nt1r
Copy link
Author

nt1r commented Nov 24, 2023

Hello, do you have the the API translated in kotlin? May I ask if I can get a copy, I'm working on my school project, it will helps a lot. Thanks

here
I have not yet added a readme.md file in the project. You can take a look at the ktor related documentation.

@cj1357
Copy link

cj1357 commented Jan 2, 2024

It seems that the model has been updated:claude-2.0

Reference #91

@caicaicaibeiqie
Copy link

Bro,I had the same problem when using "send_message", the problem still exists after updating model, it is still in debug. If a brother found a solution, can you share it?

@Randomboiii03
Copy link

I think they updated their API, can't seem to see POST request in the network console, anyone can look up if there is changes?

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

No branches or pull requests

7 participants