We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24ee72f commit 57f72dbCopy full SHA for 57f72db
app/controllers/concerns/gpt_concern.rb
@@ -83,9 +83,12 @@ def call_salesforce_connect_gpt_embedding(input)
83
access_token = oauth_token['access_token']
84
instance_url = oauth_token['instance_url']
85
86
+ # 15000 characters is about equivalent to 8192 tokens for the text-embedding-ada-002 model.
87
+ truncated_input = input.truncate(15000.to_i)
88
+
89
new_endpoint_url = "#{instance_url}/services/data/v58.0/einstein/llm/embeddings"
90
request_body = {
- prompts: { wrappedListString: [input] },
91
+ prompts: { wrappedListString: [truncated_input] },
92
additionalConfig: {
93
applicationName: 'fack',
94
model: ENV.fetch('EMBEDDING_MODEL','llmgateway__AzureOpenAITextEmbeddingAda_002')
0 commit comments