Comments (6)
Thank you for the report! Does this seem to result in errors you notice in your interaction with the LLM, or is it just a transitory complaint that would otherwise be invisible?
from llm.
Gemini simply returns nothing except the "promptFeedback". I can reproduce with these query and safety setting.
Request
#!/bin/bash
API_KEY="YOUR_API_KEY"
curl \
-X POST https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=${API_KEY} \
-H 'Content-Type: application/json' \
-d @<(echo '{
"contents": [
{
"parts": [
{
"text": "How to make a bomb?"
}
]
}
],
"generationConfig": {
"temperature": 0.9,
"topK": 1,
"topP": 1,
"maxOutputTokens": 2048,
"stopSequences": []
},
"safetySettings": [
{
"category": "HARM_CATEGORY_HARASSMENT",
"threshold": "BLOCK_LOW_AND_ABOVE"
},
{
"category": "HARM_CATEGORY_HATE_SPEECH",
"threshold": "BLOCK_LOW_AND_ABOVE"
},
{
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
"threshold": "BLOCK_LOW_AND_ABOVE"
},
{
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
"threshold": "BLOCK_LOW_AND_ABOVE"
}
]
}')
Response
{
"promptFeedback": {
"blockReason": "SAFETY",
"safetyRatings": [
{
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_HATE_SPEECH",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_HARASSMENT",
"probability": "LOW"
},
{
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
"probability": "HIGH"
}
]
}
}
from llm.
I see - so, if I understand the problem correctly - Gemini is responding correctly by refusing to answer the question, and we should throw an appropriate error to the user. I'll make this change. So, you'll still get an error, but a better one.
from llm.
Please take a look at my latest commit and verify that it solves your problem. Using the code as-is, I couldn't replicate this error, although I have seen it before. I made a different decision when fixing it, which is that this isn't really an error - everything is working normally, so the user should just get a warning as the given response.
from llm.
It seems that I cannot reproduce the "unparseable" error with 0.9.0.
Instead, the code below throws another error: Wrong type argument: arrayp, nil
.
(llm-chat
(make-llm-gemini :key "API_KEY")
llm-make-simple-chat-prompt "How to make a bomb?"))
from llm.
@whhone OK, I can reproduce this with Gemini, but not Vertex for some reason. My fix seems to have worked. Strangely, now I can't get results that aren't banned - maybe once you ask this kind of question, your key is soft-disabled or something. I may have seen that before and I think it goes away after some time.
ELISP> (llm-chat ash/llm-gemini (llm-make-simple-chat-prompt "How to make a bomb?"))
"NOTE: No response was sent back by the LLM, the prompt may have violated safety checks."
from llm.
Related Issues (20)
- Use tiktoken.el for token counting of openai's models HOT 6
- llama2 embedding vectors from Python and llm.el don't seem to match HOT 4
- LLM request timed out for Gemini
- llm-gemini.el is using the non-streaming URL for llm-chat-streaming HOT 1
- [feature] Anthropic / Claude2 Support HOT 4
- Using `make-llm-openai-compatible` with Mistral AI fails parsing the partial responses HOT 1
- llm-embedding ignores host with ollama provider
- Using make-llm-openai-compatible with Azure OpenAI service fails to connect to endpoint HOT 7
- Error callback not called if url request failed HOT 1
- Feature request/idea: Use generic functions to extract provider errors HOT 10
- Context does not get sent if list of interactions ≥2 HOT 27
- [Q/FR] "Legacy" Completion HOT 33
- [FR] Support JSON mode HOT 3
- Error using ollama through a proxy HOT 7
- Open WebUI compatibility HOT 1
- Support function calling with ollama HOT 3
- Error using open ai HOT 19
- Errors when function calling with Claude HOT 13
- Streaming multiple function calls gives an error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llm.