neo4j-contrib / neo4j-apoc-procedures

Awesome Procedures On Cypher for Neo4j - codenamed "apoc"                     If you like it, please ★ above ⇧            

Home Page:https://neo4j.com/labs/apoc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for AWS Bedrock for ml procedures

jexp opened this issue · comments

For auth for the REST calls we might need to use this: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html

Authorization = "AWS" + " " + AWSAccessKeyId + ":" + Signature;

Signature = Base64( HMAC-SHA1( UTF-8-Encoding-Of(YourSecretAccessKey), UTF-8-Encoding-Of( StringToSign ) ) );

StringToSign = HTTP-Verb + "\n" +
	Content-MD5 + "\n" +
	Content-Type + "\n" +
	Date + "\n" +
	CanonicalizedAmzHeaders +
	CanonicalizedResource;

CanonicalizedResource = [ "/" + Bucket ] +
	<HTTP-Request-URI, from the protocol name up to the query string> +
	[ subresource, if present. For example "?acl", "?location", or "?logging"];

CanonicalizedAmzHeaders = <described below>```


Not sure if this also helps:

https://docs.mendix.com/appstore/connectors/aws/amazon-bedrock/

Hey @jexp I'm the maintainer of litellm a library to simplify LLM API Calls by mapping the input/output to the OpenAI format.

Any chance we could help?

We support all 4 providers on Bedrock (Anthropic, Cohere, AI21, Amazon Titan) - https://docs.litellm.ai/docs/providers/bedrock

And have a self-hosted OpenAI-compatible server you could run to make it work within a Java context - https://docs.litellm.ai/docs/proxy_server

Code to call Claude on Bedrock:

import os 
from litellm import completion

os.environ["AWS_ACCESS_KEY_ID"] = ""
os.environ["AWS_SECRET_ACCESS_KEY"] = ""
os.environ["AWS_REGION_NAME"] = ""

response = completion(
            model="anthropic.claude-instant-v1", 
            messages=[{ "content": "Hello, how are you?","role": "user"}]
)