-
-
Notifications
You must be signed in to change notification settings - Fork 531
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
'<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0 while calling CreateEmbedding api #427
Comments
looks like similar to issue #408 , how many tokens was your prompt? |
It is a simple prompt: |
Most probably the response you are receiving is html instead of actual JSON format for the endpoint you are requesting. Please check that. Source: https://stackoverflow.com/questions/61487289/exception-is-an-invalid-start-of-a-value |
Thank you. |
Thank you all for your support. Found the root cause: it is something to do with application's IP origin country. |
Hi Team,
Need your help in resolving below error.
Error:
'<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
Stack Trace:
[Error] at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex) at System.Text.Json.Serialization.JsonConverter 1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadCore[TValue](JsonConverter jsonConverter, Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadCore[TValue](JsonReaderState& readerState, Boolean isFinalBlock, ReadOnlySpan 1 buffer, JsonSerializerOptions options, ReadStack& state, JsonConverter converterBase) at System.Text.Json.JsonSerializer.ContinueDeserialize[TValue](ReadBufferState& bufferState, JsonReaderState& jsonReaderState, ReadStack& readStack, JsonConverter converter, JsonSerializerOptions options) at System.Text.Json.JsonSerializer.ReadAllAsync[TValue](Stream utf8Json, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken) at System.Net.Http.Json.HttpContentJsonExtensions.ReadFromJsonAsyncCore[T](HttpContent content, Encoding sourceEncoding, JsonSerializerOptions options, CancellationToken cancellationToken) at OpenAI.Extensions.HttpClientExtensions.PostAndReadAsAsync[TResponse](HttpClient client, String uri, Object requestModel, CancellationToken cancellationToken) at OpenAI.Managers.OpenAIService.CreateEmbedding(EmbeddingCreateRequest createEmbeddingRequest, CancellationToken cancellationToken)
When I debug locally everything is fine.
But, when I access the code deployed as Azure Function, I am receiving above mentioned error.
Here is the code excerpt:
var result = await _gpt3.CreateEmbedding(new OpenAI.GPT3.ObjectModels.RequestModels.EmbeddingCreateRequest() { Input = text, Model = _config[SettingPropertyNames.gptEmbeddingModel] });
_gpt3
is an instance ofOpenAI.GPT3.Managers.OpenAIService
.Regards
Shadakshari
The text was updated successfully, but these errors were encountered: